I have a Spring Boot app with many sub frameworks. When I start the app I get by default logging in /opt/engine.log
. Is there some way to disable globally this logging?
Yes, you can redirect the log in different ways.
logging.file=/path/to/your/logfile.log
or, in the yaml file
logging: file: /path/to/your/logfile.log
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property name="LOG_FILE" value="/path/to/your/logfile.log"/>
<include resource="org/springframework/boot/logging/logback/file-appender.xml"/>
<root level="OFF">
<appender-ref ref="FILE"/>
</root>
</configuration>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
<File name="File" fileName="/path/to/your/logfile.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="OFF">
<AppenderRef ref="File"/>
</Root>
</Loggers>
</Configuration>
UPDATED:
You can set the root logger level to OFF or ERROR to disable logging. For that you can modify your logback.yml file.
logger:
- name: ROOT
level: OFF
And also you can disable logging for a specific appender
appender:
- name: FILE
enabled: false