wayner 3 Posted October 11, 2017 Share Posted October 11, 2017 I created a semi-manual docker for the Harmony-api using this file. It works fine and when I click on the Docker from the unRAID UI I can see the log. But I can't figure out what file the log is actually stored in. Should it be in /var/log? I don't see anything there. I am concerned that this log will grow to be very large as it is constantly polling the Logitech Harmony hubs on my LAN. It seems that it will grow to at least a few hundred kB per day. Is there any way to have the log flush every day or X number of bytes? Quote Link to post
wayner 3 Posted October 11, 2017 Author Share Posted October 11, 2017 Ok - I think I have found this. It is in the painfully named /var/lib/docker/containers/123456789074329872398471204271304723094872307234/ folder where the last parameter is the Container ID. Is that correct? And why use the Container ID rather than the docker name? That makes it a pain to find the correct docker. How do I limit the size of the log file? Or is this best done from within the application? Quote Link to post
Squid 2894 Posted October 11, 2017 Share Posted October 11, 2017 Ok - I think I have found this. It is in the painfully named /var/lib/docker/containers/123456789074329872398471204271304723094872307234/ folder where the last parameter is the Container ID. Is that correct? And why use the Container ID rather than the docker name? That makes it a pain to find the correct docker. How do I limit the size of the log file? Or is this best done from within the application?https://forums.lime-technology.com/topic/57181-real-docker-faq/?tab=comments#comment-564326Sent from my SM-T560NU using Tapatalk Quote Link to post
jj_uk 9 Posted June 20, 2018 Share Posted June 20, 2018 Is it possible to add a share in the logs folder so i can copy the log file to windows PC ? I need to send a complete log file to a vendor (google) but I cant figure out how to copy the whole log to a windows PC. Quote Link to post
wgstarks 213 Posted June 20, 2018 Share Posted June 20, 2018 4 hours ago, jj_uk said: Is it possible to add a share in the logs folder so i can copy the log file to windows PC ? I need to send a complete log file to a vendor (google) but I cant figure out how to copy the whole log to a windows PC. Not sure about creating a share, but you should be able to use the Config File Editor plugin to open the log file in your browser and just copy/paste to a text file. Quote Link to post
Squid 2894 Posted June 20, 2018 Share Posted June 20, 2018 docker logs nameOfContainer > /boot/containerLog.txt Quote Link to post
jj_uk 9 Posted June 24, 2018 Share Posted June 24, 2018 (edited) On 6/20/2018 at 11:30 PM, Squid said: docker logs nameOfContainer > /boot/containerLog.txt Thanks. I run this command: docker logs google-music-uploader > /boot/containerLog.txt and the log scrolls up the screen, the file "containerLog.txt" is created but it's empty. Edited June 24, 2018 by jj_uk Quote Link to post
Squid 2894 Posted June 24, 2018 Share Posted June 24, 2018 post the exact command you're using Quote Link to post
jj_uk 9 Posted June 24, 2018 Share Posted June 24, 2018 2 minutes ago, Squid said: post the exact command you're using root@tower1:/# docker logs google-music-uploader > /boot/containerLog1.txt Quote Link to post
Squid 2894 Posted June 24, 2018 Share Posted June 24, 2018 Nothing should be displayed on the screen at all. Command works for me if I change the name of the container no problems Quote Link to post
pwm 221 Posted June 24, 2018 Share Posted June 24, 2018 55 minutes ago, jj_uk said: Thanks. I run this command: docker logs google-music-uploader > /boot/containerLog.txt and the log scrolls up the screen, the file "containerLog.txt" is created but it's empty. Sounds like the log data is emitted to standard error instead out standard out - then you will see the text scroll on the screen while a zero-size file is created. Output emitted to standard error can be redirected with the following - the number 2 represents the stderr output stream. cmd 2> file Quote Link to post
jj_uk 9 Posted June 24, 2018 Share Posted June 24, 2018 (edited) Yes, this worked. Any ideas why its going to the error stream instead of the file stream? (unRAID version 6.5.3) Edited June 24, 2018 by jj_uk Quote Link to post
pwm 221 Posted June 24, 2018 Share Posted June 24, 2018 31 minutes ago, jj_uk said: Yes, this worked. Any ideas why its going to the error stream instead of the file stream? (unRAID version 6.5.3) Docker captures both stdout and stderr output. https://docs.docker.com/config/containers/logging/ For information about redirection, see the following link: https://askubuntu.com/questions/625224/how-to-redirect-stderr-to-a-file But > redirects stdout. And 2> redirects stderr. And &> redirects both. Or you can do: cmd > outfile 2>&1 Quote Link to post
Alex.b 12 Posted November 23, 2020 Share Posted November 23, 2020 On 6/21/2018 at 12:30 AM, Squid said: docker logs nameOfContainer > /boot/containerLog.txt I tried to capture logs but I have an error : root@Sparta:~# docker logs deconz > /mnt/user/Downloads/containerLog.txt /usr/bin/xauth: file /root/.Xauthority does not exist QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile QObject::connect: Cannot queue arguments of type 'QTextBlock' (Make sure 'QTextBlock' is registered using qRegisterMetaType().) QObject::connect: Cannot queue arguments of type 'QTextCursor' (Make sure 'QTextCursor' is registered using qRegisterMetaType().) Quote Link to post
Squid 2894 Posted November 23, 2020 Share Posted November 23, 2020 Are you sure that's not the output from the docker logs command? It's kinda weird the way the command works because it outputs to stderr the errors in the logs. You need to add 2>&1 to the command to also send the errors to the file Quote Link to post
Alex.b 12 Posted November 23, 2020 Share Posted November 23, 2020 (edited) Thank, is there another way to get the logs? I had to enable the debugging options of a container for a developer and there are so many lines per second that Firefox crashes before I had time to copy logs (I need to collect around 5 mins of logs). Edited November 23, 2020 by Alex.b Quote Link to post
Squid 2894 Posted November 23, 2020 Share Posted November 23, 2020 Just add what I suggested to your command Quote Link to post
Alex.b 12 Posted November 23, 2020 Share Posted November 23, 2020 Perfect ! Thank you @Squid Quote Link to post
18 posts in this topic Last Reply
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.