github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-logs.1.md.in (about)

     1  % podman-logs 1
     2  
     3  ## NAME
     4  podman\-logs - Display the logs of one or more containers
     5  
     6  ## SYNOPSIS
     7  **podman logs** [*options*] *container* [*container...*]
     8  
     9  **podman container logs** [*options*] *container* [*container...*]
    10  
    11  ## DESCRIPTION
    12  The podman logs command batch-retrieves whatever logs are present for one or more containers at the time of execution.
    13  This does not guarantee execution order when combined with podman run (i.e. the run may not have generated
    14  any logs at the time podman logs was executed).
    15  
    16  ## OPTIONS
    17  
    18  @@option color
    19  
    20  @@option follow
    21  
    22  @@option latest
    23  
    24  @@option names
    25  
    26  @@option since
    27  
    28  @@option tail
    29  
    30  @@option timestamps
    31  
    32  @@option until
    33  
    34  ## EXAMPLE
    35  
    36  To view a container's logs:
    37  ```
    38  podman logs -t b3f2436bdb978c1d33b1387afb5d7ba7e3243ed2ce908db431ac0069da86cb45
    39  
    40  2017/08/07 10:16:21 Seeked /var/log/crio/pods/eb296bd56fab164d4d3cc46e5776b54414af3bf543d138746b25832c816b933b/c49f49788da14f776b7aa93fb97a2a71f9912f4e5a3e30397fca7dfe0ee0367b.log - &{Offset:0 Whence:0}
    41  1:C 07 Aug 14:10:09.055 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    42  1:C 07 Aug 14:10:09.055 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
    43  1:C 07 Aug 14:10:09.055 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    44  1:M 07 Aug 14:10:09.055 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
    45  1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
    46  1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
    47  1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
    48  1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    49  1:M 07 Aug 14:10:09.056 # Server initialized
    50  ```
    51  
    52  To view only the last two lines in container's log:
    53  ```
    54  podman logs --tail 2 b3f2436bdb97
    55  
    56  # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    57  # Server initialized
    58  ```
    59  
    60  To view all containers logs:
    61  ```
    62  podman logs -t --since 0 myserver
    63  
    64  1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
    65  1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
    66  1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
    67  1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    68  1:M 07 Aug 14:10:09.056 # Server initialized
    69  ```
    70  
    71  To view a container's logs since a certain time:
    72  ```
    73  podman logs -t --since 2017-08-07T10:10:09.055837383-04:00 myserver
    74  
    75  1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
    76  1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
    77  1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
    78  1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    79  1:M 07 Aug 14:10:09.056 # Server initialized
    80  ```
    81  
    82  To view a container's logs generated in the last 10 minutes:
    83  ```
    84  podman logs --since 10m myserver
    85  
    86  # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
    87  # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit, Increase 'ulimit -n' when higher maxclients are required.
    88  ```
    89  
    90  To view a container's logs until 30 minutes ago:
    91  ```
    92  podman logs --until 30m myserver
    93  
    94  AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
    95  AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
    96  [Tue Jul 20 13:18:14.223727 2021] [mpm_event:notice] [pid 1:tid 140021067187328] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations
    97  [Tue Jul 20 13:18:14.223819 2021] [core:notice] [pid 1:tid 140021067187328] AH00094: Command line: 'httpd -D FOREGROUND'
    98  ```
    99  
   100  ## SEE ALSO
   101  **[podman(1)](podman.1.md)**, **[podman-run(1)](podman-run.1.md)**, **[podman-rm(1)](podman-rm.1.md)**
   102  
   103  ## HISTORY
   104  February 2018, Updated by Brent Baude <bbaude@redhat.com>
   105  
   106  August 2017, Originally compiled by Ryan Cole <rycole@redhat.com>