Set log redirection from docker run command

In order to get logs redirected to a file, I follow the faq entry which tell to change the config.yaml file.

But I would know if it is possible to set the log file directly from the docker command.

May I ask what’s the need for setting it through docker when it achieves the same goal?

i use this to preserve the docker logs functionality, it’s based on a docker command that exports to a file, and is basically that and a cron job.

one thing to keep in mind is that if the log file in docker gets large… like hundreds of mb, then it will start taking up a bit of resources… not bad tho… had the node running for a month and by the end it took about 2% avg of cpu resources.

1 Like

May I ask what’s the need for setting it through docker when it achieves the same goal?

  • For simplicity and coherency.
    I have asked this question because I am creating a script to set up a node.

  • I also think that it is a source of error to have two ways to set parameters. The config.yaml should at least be filled with the parameters set from the docker command.

  • I would prefer have the log file outside the container because I have experienced some db issues while trying to read them while the node was running. I know it is due to sqlite, but I would be more tranquil if there is outside the container.

  • My goal is to put put data from log to a db, may be it would be simpler to get that directly from sqlite dbs ?

@SGC in response oto your question about execute command directly in cron: try to explicitly execute bash https://unix.stackexchange.com/a/240596

Whatever you don’t specify in docker run is picked up from config.yaml. Try this link if it helps.

When you are successful do update this thread.

1 Like

thanks ill give that a look and test if i can get that to work… been wanting to make it into essentially a one command, even if a rather extensive one… it does make it a lot more easy for others to implement.

i forget the exact reasons i couldn’t get it to work, i think it was something like some stuff would work in docker command line other stuff would not work in cron, so a bash script became the patch.

and in regard to you wanting access to the storj db then
the databases are located with the storagenode data files… storj/storage i believe is the default
same place as the blobs folder… which is in /storj/storage/blobs … its the big one :smiley:
in case you can’t find it… and ofc anything inside the /storj/storage folder is strictly off limits for you to change something to keep in mind… tho i’m sure you are aware…

sorry if the gross oversimplification is an offence… not always easy to know peoples skill level or which considerations they take.

sorry if the gross oversimplification is an offence… not always easy to know peoples skill level or which considerations they take.

I appreciate your intention !
Whatever my skill level, I prefer read detailled explanations.

I think it would be better to read directly from the dbs, but for the moment I will stay reading the logs.