Log file- every month new log file

I would like to suggest to make every month new log file, just add to storagenode a month and year
It is hard to trace 100 mb log and it it only 3 month long.
Every time it takes about 20-30s to open it and it is on SSD drive.

1 Like

Setup logrotate. I don’t think we should implement what logrotate already provides.

2 Likes

dont see any logrotate as log file on GUI 939MB
Also in config no such configuration

https://www.google.com/search?q=logrotate

It is GUI instalation not linux

https://lmgtfy.com/?q=logrotate+windows

1 Like

not understand why need to make it thow ***hole and cant make it natevly supported
soon we need 50 differend software to mantance node.
If there is beter idea, please all welcomed to write, this is for this post is here

2 Likes

Have to agree, it’s not helpful either on windows or linux if SNOs have to set up logrotate externally.
Please either implement it into storagenode or provide a simple script for linux and windows that will set up logrotate.

I have to disagree. Logrotate is a very basic tool. We have to draw a line between tools that the OS should have and our responsibilites. Otherwise the next request will be a build in text editor to modify the config file.

So if you need something like logrotate on windows you might want to contact the windows support! Or just install it instead of hoping that someone else will install it for you.

2 Likes

The Unix Philosophy:

  1. Make each program do one thing well. To do a new job, build afresh rather than complicate old > programs by adding new features.

  2. Expect the output of every program to become the input to another, as yet unknown, program. Don’t clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don’t insist on interactive input.

  3. Design and build software, even operating systems, to be tried early, ideally within weeks. Don’t hesitate to throw away the clumsy parts and rebuild them.

  4. Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you’ve finished using them.

2 Likes

Unix is last century, but it not make it bad.

Also there is a problem to write same files with 2 different process on windows.
Can make a problem.

there is only needed that storagenode once a month close noragenode.txt renam it and start new file.

That’s exactly what logrotate does. Logrotate can also be configured to compress the log files after a certain time frame. It’s a must have and understand utility for any DevOps sysadmin.

Other must have and understand text processing utilities are:

  1. cat and zcat
  2. grep and zgrep
  3. cut
  4. head
  5. tail

There are plenty of others, but one can get a lot done with just a little bit of know-how with these five utilities. However, I haven’t used MS Windows for a long long time, so I don’t know how many are available on Windows. I seem to remember reading about Microsoft porting over a bunch of Unix-like utilities into so called “PowerShell” … but I don’t know any of the details.

zcat and zgrep particularly awesome. They allow one to directly process compressed text files, such as old logrotate compressed logs.

problem is that you cant change name on windows file, if it opend by other App, and storagenode keeps it opened all the time.

logrotate man page

copytruncate

Truncate the original log file in place after creating a copy, instead of moving the old log file and optionally creating a new one. It can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever. Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost. When this option is used, the create option will have no effect, as the old log file stays in place.

2 Likes

You can get a full linux shell with all the tools. It is a build in feature called “Windows subsystem for linux”. Only a few clicks to activate that feature.

For a simple logrotate that might be too much. I want to point it out just in case someone wants to get the full package instead of installing only a tiny bit of it.

3 Likes

as i mentiond on other post log shold be better.
I tried to use some soft but on GUI version storagenode bloking file.
I avaleble only for read. Storagenode cold make new one each month in 3 month i got 1GB of text not posible to find something there.

Well, you don’t, really. At least in my opinion I don’t imagine the average node operator wanting to view logs from weeks or even months ago. All you need to do is open the dashboard to see if it’s online, maybe monitor the bandwidth and disk usage because statistics are fun. Some might even run one of the community scripts if they really like statistics. All the (awesome!) stuff people do here is usually not really required to run a node.

they need if something is bad hapened, and if your log is GB or more it is very hard to find fomething.

Even if nobody looks at it, the logfile by default will increase forever. So after a few month a SNO has one logfile with over 10GB. not sure that’s a preferable scenario.