Hi. My “storagenode.log” in “C:\Program Files\Storj\Storage Node” got above 600MB, and Notepad++ says its too big to open lol. Node got few months. Can You think about some systemic solutions?
You can stop your node (docker stop -t 300 storagenode
), rename storagenode.log
to storagenode1.log
& create another new file named storagenode.log
. In this way you can keep track of old log while having new file that you can open easily.
To start your node again you can use docker start storagenode
Logrotate can help
As @nerdatwork said, but seems you run a Windows GUI, so you should stop the storagenode service instead of docker stop
and start the service instead of docker start
.
From the elevated powershell to stop the storagenode service:
Stop-Service storagenode
Rename the log
mv "$env:ProgramFiles/Storj/Storage Node/storagenode.log" "$env:ProgramFiles/Storj/Storage Node/storagenode-$(date -Format 'yyyy-MM-dd-hh-mm').log"
And start the service:
Start-Service storagenode
Does the windows GUI or anything else depend on the log for reporting numbers? Why not just start a new log monthly and rename the old log. This feature is already built into the storj-updater that renames the old install file with the version number and then downloads the updated one, so why not do the same thing for the log file at the beginning of every month or end of the previous month?
It would mean a stop and restart of the node just like the updater does or could the storjnode close the log file and open a new one on the fly?
Already asked this queston, Storj decided not deal with external things. They proposed use logorate for this. But it complecated, when file is used by other process.
You can run a batch file with this content:
net stop storagenode
del /q "%ProgramFiles%\Storj\Storage Node\storagenode.log"
net start storagenode
by Windows scheduler once a month
The same for Powershell:
Stop-Service storagenode
Remove-Item "$env:ProgramFiles\Storj\Storage Node\storagenode.log"
Start-Service storagenode
may be not delete just rename.
Yup. Just rename should work. and windows should amend the filename if it is the same.
Then replace the del
to move
to other file and Remove-Item
to the Move-Item
for the powershell version.
You can name them as a date + time as there:
No i mean, do something with this please.
The node produces 1GB - 1,7GB every 1,5-3 weeks.
I don’t have so much space for logs.
Often the logs makes 0MB space on C: and the node starting to get problems, and require restart to proper functioning.
Its not even a debug level, just normal produces so much GB in .log
Can You make it produce much less GB? or add us a command to set a self delete for log for above given GB, for example let me set 1GB, and it will self delete if log passes that, and file will start form fresh 0MB again without need to oversight it?
Why would a node do something with it? There are dedicated systems to deal with logs.
Or you may install WinLogRotate and configure it similar to: