%d{yyyyMMdd HH:mm:ss.SSS} [%thread] %-3level %" /> %d{yyyyMMdd HH:mm:ss.SSS} [%thread] %-3level %" /> %d{yyyyMMdd HH:mm:ss.SSS} [%thread] %-3level %"/>

How do I convert the logback.xml configuration file to an application.yml configuration file?

39 Views Asked by At
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyyMMdd HH:mm:ss.SSS} [%thread] %-3level %logger{5} - %msg %n</pattern>
</encoder>
</appender>
<logger name="jdbc" level="OFF"/>
<logger name="jdbc.sqlonly" level="OFF"/>
<logger name="jdbc.sqltiming" level="DEBUG"/>
<logger name="jdbc.audit" level="OFF"/>
<logger name="jdbc.resultset" level="OFF"/>
<logger name="jdbc.resultsettable" level="DEBUG"/>
<logger name="jdbc.connection" level="OFF"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

enter image description here

I am trying to disable logs such as jdbc.audit in the application.yml file, but it doesn't seem to be working. I am writing to you from South Korea. I am using Google's Gemini translation service to communicate with you, so please bear with me if there are any misunderstandings or errors in my English.


  datasource:
      url: jdbc:log4jdbc:oracle:thin:@localhost:1521:XE
      username: TODAY
      password: Oracle12345678
      driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
logging:
  level:
    root: info
    org:
      springframework:
        jdbc:
          level: off
          core: off
          audit: off

I am facing an issue with log configuration in my application. When I use the logback.xml file to configure logging, specific logs like jdbc.audit are successfully suppressed. However, when I try to achieve the same configuration using the application.yml file, the log levels defined in the file seem to have no effect, and the jdbc.audit logs are still being generated.

0

There are 0 best solutions below