Unable to save java melody logs

80 views Asked by At

Trying to retain(save) java melody logs as they the /temp gets cleared during container restart.

  1. Have tried relocating the log file location to other location (works fine on local), but on server this doesn't work.
  2. Also tried moving files to another remote location and try to replace them in temp after container restart, server does not pick them up.
2

There are 2 answers

1
Miguel Suarez Peleteiro On

Trying to save files within a container is not the way to go if you want to retain your javamelody logs.

Javamelody has a detailed guide on how to setup a centralized server for log retention

0
evernat On

You may retain javamelody data between container restarts by persisting it.

For example, with a volume in Docker, I use myself in docker-compose.yml something like :

services:
  mywebapp:
    image: "mywebapp:latest"
    volumes:
      - javamelody_mywebapp:/tmp/javamelody
volumes:
  javamelody_mywebapp: