How to show logfile in spring-boot-admin?

Viewed 8951

I'm using spring-boot-admin-ui to monitor my web applications. Logging is configured with log4j2, in log4j2-spring.xml.

Question: how can I show those logfiles in admin-ui? As far as I read it could display logback out of the box. But how can I enable log4j2 support, if possible at all?

The logfile is like:

<Loggers>
   <Root level="DEBUG">
        <AppenderRef ref="APP" />
        <AppenderRef ref="XML" />
        <AppenderRef ... />
    </Root>
</Loggers>

I'd like to see the last X lines of the logfiles in admin-ui, or being able to directly download them via ui.

2 Answers

It is enough just to add a property file to the application.properties

"logging.file.name=logging.txt".

P.S. The name of the file and its extension to test.

Related