Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Where are Docker logs stored by default?

Featured Replies

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?

  • Author

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?

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-564326

Sent from my SM-T560NU using Tapatalk

  • 8 months later...

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.

 

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.

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 by jj_uk

2 minutes ago, Squid said:

post the exact command you're using

root@tower1:/# docker logs google-music-uploader > /boot/containerLog1.txt

 

Nothing should be displayed on the screen at all.  Command works for me if I change the name of the container no problems

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

Yes, this worked. Any ideas why its going to the error stream instead of the file stream? (unRAID version 6.5.3)

 

Edited by jj_uk

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

 

  • 2 years later...

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

  • 1 year later...

I have a slightly different but related question.

 

When I upgrade a docker app, there is a pop up with details about the upgrade. After the upgrade completes and I close that window and later find out that the upgrade failed, how do I know what the previous version of the docker image was? It's always set to xxx:latest in the template so there's no way of knowing after the operation completes what it was before. Is this information/log saved anywhere?

 

When filing an issue/ticket against the app, I'd like to know what the source and destination versions where that caused the failure.

 

2 hours ago, frakman1 said:

I have a slightly different but related question.

 

When I upgrade a docker app, there is a pop up with details about the upgrade. After the upgrade completes and I close that window and later find out that the upgrade failed, how do I know what the previous version of the docker image was? It's always set to xxx:latest in the template so there's no way of knowing after the operation completes what it was before. Is this information/log saved anywhere?

 

When filing an issue/ticket against the app, I'd like to know what the source and destination versions where that caused the failure.

 

Typically you can view past releases on the dockerhub page for that docker.

20 hours ago, wgstarks said:

Typically you can view past releases on the dockerhub page for that docker.

Unfortunately there is no way of knowing what the version I had running before the upgrade was. Was it the previous version? Was the it the one before that? etc.

I don't upgrade as soon as a new release is made so it could be anything in the last year.

 

Is there a log of the docker upgrade operations and associated output anywhere?

@Squid

It just seems wrong that if I didn't happen to take a screenshot of the docker upgrade popup then it's gone forever.

Edited by frakman1

10 hours ago, frakman1 said:

Is there a log of the docker upgrade operations and associated output anywhere?

 

no

 

I'm sure via applicable docker commands (inspect?) you could determine the digest of the container you were running and then compare that to the digest of the various tags to determine what :latest equated to, but it's a pain.

5 hours ago, Squid said:

you could determine the digest of the container you were running 

 

Thank you for the definitive answer and suggestion.

 

I don't understand where the previous container's digest would be. Doesn't the old container get blown away after an upgrade? The only "inspect" I can run is on the new container.

I also thought that an upgrade explicitly removed the orphan image that was the previous "latest" tagged image. I remember seeing that in the logs as the last step of the upgrade process.

So after an upgrade, both the old container and the old image are gone and all I have is the new image and the new container created from it. Am I missing something?

 

Maybe there's a misunderstanding. I'm not trying to figure out what version the current "latest" tag corresponds to. Yes, I can compare digests to published values.

I am trying to determine the version of the previous version of the app just before the failed upgrade. It was also tagged as "latest".

  • 2 years later...

Any idea on how to clear the log of a container?

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.