Log size, and rotating

Am I the only one extremely annoyed by log sizing. I would prefer to store long term logs of relevant issues. However dealing with a massive amount of “context canceled” that should technically be living in the “info” verbosity of the log data is an issue. Moving to fatal removes valuable log entries.

The log size, is so bad, that it’s an obvious issue for new operators. People don’t even know what to look for etc. I feel like improving the log verbosity dataset could help quite a bit in the management of nodes.

2 Likes

Thank you for sharing your experience and preferences.
I’ve passed this on to the team.

2 Likes

Yea, and i can share what i did, i used this script here, and i keep “info” level, and copy them every 3 days to BIG HDD, and then i plan to winrar them with “best” it compress that very well.

You can use logrotate to rotate and compress logs. Tools like bzgrep can parse compressed logs, so having logs compressed does not affect anything.

I’d suggest to create the compressed log in the first place — there is no reason to have them plaintext.

2 Likes

Neither of those are really solutions when it comes to properly managing a service. It’s like a needle in a hatystack theory, and your solution is to bail all the hay. Which will likely make finding the needle harder…

I don’t follow the analogy. What do you mean?

By compressing the logs you can keep years of history, and all your log analysis still works. You can still grep for whatever you want. Want to see errors? Filter by errors. Want to see context around — add context flags (e.g. -B 10). In case you lost a piece and need to track it down for example.

I’m the first one to advocate to delete databases on every start as they are completely useless and at the same time I’m the one advocating for keeping full logs forever.

More logs is always better than fewer, especially highly compressible logs like storagenode is producing that are essentially free to store.

It happened to me that chunk was uploaded, deleted, and failed audit, in that order. Was not my nodes fault, was some experiment storj was running, but keeping all logs was helpful to figure this out. I never delete logs.

3 Likes

I think, OP wants the log to be more trimmed by not showing context canceled and other “irrelevant” entries thereby making logs shorter. OP is not looking for options on how to rotate the logs.

3 Likes

Good point. I agree that context cancelled shall be info level, as this is an expected part of normal node operation

You can also always switch to the error log level only (or warning).
I personally uses a logrotate and the info log level on case if we introduce a bug. My logs keeping for the last 3 years.
This helped me to prove a bug at least once :slight_smile: (my node was disqualified and then restated because I have had an evidence).

3 Likes

This is correct. log verbosity is pretty much pointless right now.

you have a such log levels: error, warn, info and debug

Do you know what log levels are for?

Ummmmm, I have no clue why this convo is degrading so badly. The verbosity of the logs is not organized correctly. If someone wants to save all the logs and rotate them that’s fine, use info. If someone wants to use error, they should be able to use error without a bunch of garbage.

Sorry, that was a question to Alexey.

1 Like

If it cheers anyone up, I put in a PR last night to move the “context canceled” stuff to Info level, though Storj’s CI seems to not like it very much - the tests worked on my machine (though I only ran them for that specific part since that’s all I changed) and that part appears to pass tests on their end, but it looks like other parts aren’t happy with the change I made so I’ll need to sit down and do some debugging over the next couple of days. Don’t worry, the log spam has been irritating me too :wink:

6 Likes

THANK YOU!

My skills with programming are novice at best. For me to contribute it would have taken months to figure out.

Ha, no worries! I’m pretty new to the language Storj is written in too, I just had an idea of where I should be looking. Right now I probably need someone more experienced than me to take a look and see if the errors are my fault or not, since I don’t really know how to read Go’s test output - the test failures seem to be in modules that I didn’t touch (and that GoLand seems pretty confident don’t interact with the parts of the code I changed when I asked it to check references for me). Either way, dipping my toes in and learning on a project I actually use is always fun :slight_smile:

3 Likes

The verbosity of the logs, and I answered a couple of years ago:

And what reason is to differentiane in verbosity of logs? What purpose there is for having different log levels?

File size, primarily. If they are too large they become difficult to look through as well as they can use valuable drive space.