Re: Need help in configuring localHostname in log4j2 syslog appender
"Piotr P. Karwasz" <[email protected]> Tue, 2 May 2023 10:19:15 +0200
| Newsgroups | gmane.comp.jakarta.log4j.user |
|---|---|
| Message-ID | <CAFmygFbBzd_MdyuAG2Kbw7bx2JgcQL1MCaP+przYn8svBPjrPw@mail.gmail.com> |
Hi Ganesh, On Tue, 2 May 2023 at 04:12, Ganesh S <[email protected]> wrote: > I'm trying to implement remote logging for my application which is running > in a docker container. > The remote server provider is Papertrail. > I want to specify a custom local host name, currently it is taking > container id, which I don't want. As Volkan explained, Log4j2 uses the hostname of your OS as syslog hostname. I think that your problem is that the hostname of your Docker container is not what you would expect. You can change it with `--hostname` parameter to `docker run`: https://docs.docker.com/config/containers/container-networking/ Piotr