Can I forward the logs in some specific location not on a Node disk?

Can I forward the logs in some specific location not on a Node disk?
Something like:
D:/Storj/Logs/node5.log

Yes you can, but it would not be so convenient.
You need to add another mount binding to the container and update log.output option with a new path either in config.yaml or as a command line argument for docker run, i.e.

docker run -d ... --mount type=bind,source=D:/Storj/Logs/,destination=/app/logs/ --name node5 storjlabs/storagenode:latest --log.output=/app/logs/node5.log

However, if you want to use the same folder for all your nodes - then it likely would not be possible. But you can try to bind a log file only, not the folder, i.e.:

docker run -d ... --mount type=bind,source=D:/Storj/Logs/node5.log,destination=/app/logs/node5.log --name node5 storjlabs/storagenode:latest --log.output=/app/logs/node5.log
3 Likes

Yep, I’m talking about log redirection only, that could be gathered in one folder on a different disk.

So it leads to create additional container instance for log file?

No. You need to extend your current docker run command with additional mount option to bind a new location on your host to the path inside the container and add a command line argument to provide a path inside the container.

Is it correct:

docker run -d --restart unless-stopped --stop-timeout 300 -p 28969:28967/tcp -p 28969:28967/udp -p 127.0.0.1:14004:14002 -e WALLET="XXX" -e EMAIL="YYY@YYY.YYY" -e ADDRESS="ZZZ:28969" -e STORAGE="11TB" --mount type=bind,source="M:\identity\storagenode5\",destination=/app/identity --mount type=bind,source="M:\data\",destination=/app/config --mount type=bind,source="D:\Storj\Logs\node5.log",destination=/app/logs/node5.log --name storagenode5 storjlabs/storagenode:latest --log.output=/app/logs/node5.log

udp: works for Windows

Yes. Maybe your docker version would not allow to use the path in a “Linux” format (D:/Storj/Logs/node5.log), in this case you can change it to D:\Storj\Logs\node5.log.

This command line run not appropriate:
It is creates some folder named by node5.log, instead of the TXT file node5.log.
The folder node5.log is empty.

After the command initiate the Node container appears in Docker container list, but it won’t let to look for the Node stats via http://127.0.0.1:14004/

The node not starts completely.

Is a --log.output=/app/logs/node5.log parameter should in the end of a command line?

I can provide the running log but it seems a bit long.

docker run -d --restart unless-stopped --stop-timeout 300 -p 28969:28967/tcp -p 28969:28967/udp -p 127.0.0.1:14004:14002 -e WALLET="XXX" -e EMAIL="YYY@YYY.YYY" -e ADDRESS="ZZZ:28969" -e STORAGE="11TB" --mount type=bind,source="M:\identity\storagenode5\",destination=/app/identity --mount type=bind,source="M:\data\",destination=/app/config --mount type=bind,source=D:\Storj\Logs\node5.log,destination=/app/logs/node5.log --name storagenode5 storjlabs/storagenode:latest --log.output=/app/logs/node5.log

You need to create an empty file D:\Storj\Logs\node5.log, if it does not exist yet.
PowerShell:

docker stop -t 300 storagenode5
docker rm storagenode5
new-item D:\Storj\Logs\node5.log
docker run -d --restart unless-stopped --stop-timeout 300 -p 28969:28967/tcp -p 28969:28967/udp -p 127.0.0.1:14004:14002 -e WALLET="XXX" -e EMAIL="YYY@YYY.YYY" -e ADDRESS="ZZZ:28969" -e STORAGE="11TB" --mount type=bind,source="M:\identity\storagenode5\",destination=/app/identity --mount type=bind,source="M:\data\",destination=/app/config --mount type=bind,source=D:/Storj/Logs/node5.log,destination=/app/logs/node5.log --name storagenode5 storjlabs/storagenode:latest --log.output=/app/logs/node5.log

is there goes without double quotes?

They are necessary only if your path has spaces. But you can add them anyway, it will not hurt. Just make sure to use a straight ones: ", not a curly ones like and

if there appears some permission errors - need to look for rights/permissions of the folder where ‘.log’ file should created.

These proccess works - at least the ‘.log’ file created and all the Docker log rerouted to this file.
Try to drive the Node a couple of days for gathering info.
If all will goes well, I will expand this command to the others.

I think you forgot to remove the previously created folder D:\Storj\Logs\node5.log\ and the container must be removed.
You can remove the folder:

Remove-Item -Force -Recurse D:\Storj\Logs\node5.log\

Then you sorted that out already

I have removed the folder node5.log before as the same created file.
It’s some strange Windows behavior - all the Disks/Folders/Files goes with Owner-Creator entity.

Yes, this is a default meta group added by Windows to every new disk after initialization. It allows to make an owner any user, who created a file/folder. Usually it works ok. But if you have several different users, and uses some service like storagenode, it could hit you.
For example, if you migrate your data - you will become an owner and with high probability the storagenode cannot start after - it will lost an access to data. So I usually recommend to remove inheritance for the storagenode’s data location and apply permissions directly, making the SYSTEM an owner and adding full rights to it.
However, in case of docker the storagenode container is running with user’s rights, so, the owner and full control must be granted to your user instead of SYSTEM.

But now, if your setup is working, I would not recommend to touch it.

When I had redirected the node2 logs I have obtained the following messages in Docker logs:

2022-05-10T07:40:52.962Z INFO Configuration loaded {"Process": "storagenode-updater", "Location": "/app/config/config.yaml"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "contact.external-address"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "server.address"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "storage.allocated-disk-space"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "operator.wallet"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "server.private-address"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "operator.email"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file key {"Process": "storagenode-updater", "Key": "storage.allocated-bandwidth"}

2022-05-10T07:40:52.962Z INFO Invalid configuration file value for key {"Process": "storagenode-updater", "Key": "log.level"}

2022-05-10T07:40:52.968Z INFO Running on version {"Process": "storagenode-updater", "Service": "storagenode-updater", "Version": "v1.53.1"}

2022-05-10T07:40:52.968Z INFO Downloading versions. {"Process": "storagenode-updater", "Server Address": "https://version.storj.io"}

2022-05-10T07:40:53.527Z INFO Current binary version {"Process": "storagenode-updater", "Service": "storagenode", "Version": "v1.53.1"}

2022-05-10T07:40:53.528Z INFO New version is being rolled out but hasn't made it to this node yet {"Process": "storagenode-updater", "Service": "storagenode"}

2022-05-10T07:40:53.549Z INFO Current binary version {"Process": "storagenode-updater", "Service": "storagenode-updater", "Version": "v1.53.1"}

2022-05-10T07:40:53.549Z INFO New version is being rolled out but hasn't made it to this node yet {"Process": "storagenode-updater", "Service": "storagenode-updater"}

2022-05-10 07:40:54,552 INFO spawned: 'processes' with pid 96

2022-05-10 07:40:54,552 INFO success: storagenode entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-10 07:40:54,552 INFO success: storagenode-updater entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-10 07:40:54,556 INFO exited: processes (exit status 0; not expected)

2022-05-10 07:40:56,560 INFO spawned: 'processes' with pid 98

2022-05-10 07:40:56,563 INFO exited: processes (exit status 0; not expected)

2022-05-10 07:40:59,568 INFO spawned: 'processes' with pid 106

2022-05-10 07:40:59,573 INFO exited: processes (exit status 0; not expected)

2022-05-10 07:40:59,573 INFO gave up: processes entered FATAL state, too many start retries too quickly

Is it normal?

If you redirected logs to the file with --log.output option, then these messages should not appear in the log file, they posted to stderr of the container, so you can see them only with docker logs.

You should check logs in a new location, not with docker logs, i.e.

cat -Tail 10 d:\Storj\Logs\node2.log

this error is discussed there: Processes entered FATAL state, too many start retries too quickly