Answers: <p>I got a work around to this case. basically, My root volume is 100GB and I created a separate partition out of it as 70GB and I set it to a new device sda3 and mounted it to /var/lib.</p>
  <p>now, all docker container logs are written in same path but in backend they are mounted to a different drive. with this setup, even if there is disk pressure, the node does not become unavailable.</p>
  <p>so my drive now looks liek below</p>
  <pre><code>sda1
  sda2 / 30GB
  sda3 /var/lib 70GB.  &lt;&lt; new device
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2021-01-25T19:56:47.570Z
Answers: 2021-01-25T19:56:47.570Z
Answers: AhmFM
Body: <p>Team:
  All my container logs are under /var/log/containers..</p>
  <p>Where in kubelet or docker config can I specify this path such that logs are instead created under new path?
  Ex : /shared ? Instead of /var/log</p>
  
Comments: CC BY-SA 4.0
Comments: 2020-12-18T12:25:32.087Z
Comments: I can't find anything either. It's also the case with containerd runtime. Good point. If you can't figure it out, one way to go about this might be to mount-bind your /var/log/containers from your arbitrary logs directory - see https://serverfault.com/a/613184/293779
Comments: SYN
Comments: CC BY-SA 4.0
Comments: 2020-12-20T00:17:57.987Z
Comments: @AhmFM could you specify why you want the change the log path?
Comments: c4f4t0r
Comments: CC BY-SA 4.0
Comments: 2020-12-21T06:43:58.017Z
Comments: Because I don’t like users writing to root directly. So I created a slice partition from root and want container logs to be written there instead.
Comments: AhmFM
Comments: CC BY-SA 4.0
Comments: 2021-01-23T20:45:49.163Z
Comments: You might circumvent this by using syslog, or other logging facility if you can configure the host and set up the log path there.
Comments: karatedog
Tags: <docker><kubernetes><containers>
Title: Change docker container’s log PATH
UserDisplayName: AhmFM
ThreadText: # Change docker container’s log PATH
  
  (Asked by: username_0 on 2020-12-18)
  
  Team:
  All my container logs are under /var/log/containers..
  
  Where in kubelet or docker config can I specify this path such that logs are instead created under new path?
  Ex : /shared ? Instead of /var/log
  
  **Tags:** docker, kubernetes, containers
  
  > **Comments:**
  > **username_1**: I can't find anything either. It's also the case with containerd runtime. Good point. If you can't figure it out, one way to go about this might be to mount-bind your /var/log/containers from your arbitrary logs directory - see https://serverfault.com/a/613184/293779  
  > **username_2**: @username_0 could you specify why you want the change the log path?  
  > **username_0**: Because I don’t like users writing to root directly. So I created a slice partition from root and want container logs to be written there instead.  
  > **username_3**: You might circumvent this by using syslog, or other logging facility if you can configure the host and set up the log path there.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-01-25. Score: 1
  
  I got a work around to this case. basically, My root volume is 100GB and I created a separate partition out of it as 70GB and I set it to a new device sda3 and mounted it to /var/lib.
  
  now, all docker container logs are written in same path but in backend they are mounted to a different drive. with this setup, even if there is disk pressure, the node does not become unavailable.
  
  so my drive now looks liek below
  
  ```
  sda1
  sda2 / 30GB
  sda3 /var/lib 70GB.  << new device
  
  ```
  
  
  ---
  
  