Jak skonfgurować log4j aby archiwizował tylko moje logi

0

Aktualnie moj properties plik wygląda:

# Root logger option
log4j.rootLogger=DEBUG, stdout, file

# Redirect log messages to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

# Redirect log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
#outputs to Tomcat home
log4j.appender.file.File=${catalina.home}/logs/myapp.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}

I teraz archiwizuje mi "spam" w postaci a chciałbym to pominąć:

2017-05-11 16:19:09 DEBUG DefaultListableBeanFactory:1670 - Invoking afterPropertiesSet() on bean with name 'home'
2017-05-11 16:19:09 DEBUG DispatcherServlet:1276 - Rendering view [org.springframework.web.servlet.view.JstlView: name 'home'; URL [/WEB-INF/views/home.jsp]] in DispatcherServlet with name 'dispatcher'
2017-05-11 16:19:09 DEBUG DefaultListableBeanFactory:251 - Returning cached instance of singleton bean 'requestDataValueProcessor'
2017-05-11 16:19:09 DEBUG JstlView:166 - Forwarding to resource [/WEB-INF/views/home.jsp] in InternalResourceView 'home'
2017-05-11 16:19:09 DEBUG HttpSessionSecurityContextRepository:352 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2017-05-11 16:19:09 DEBUG DispatcherServlet:1000 - Successfully completed request
2017-05-11 16:19:09 DEBUG DefaultListableBeanFactory:251 - Returning cached instance of singleton bean 'delegatingApplicationListener'
2017-05-11 16:19:09 DEBUG ExceptionTranslationFilter:116 - Chain processed normally
2017-05-11 16:19:09 DEBUG SecurityContextPersistenceFilter:119 - SecurityContextHolder now cleared, as request processing completed
2017-05-11 16:19:09 DEBUG FilterChainProxy:325 - /resources/js/jquery-3.2.1.min.js at position 1 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2017-05-11 16:19:09 DEBUG FilterChainProxy:325 - /resources/js/jquery-3.2.1.min.js at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2017-05-11 16:19:09 DEBUG HttpSessionSecurityContextRepository:186 - HttpSession returned null object for SPRING_SECURITY_CONTEXT
2017-05-11 16:19:09 DEBUG HttpSessionSecurityContextRepository:116 - No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@3e73f85b. A new one will be created.
2017-05-11 16:19:09 DEBUG FilterChainProxy:325 - /resources/js/jquery-3.2.1.min.js at position 3 of 12 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2017-05-11 16:19:09 DEBUG HstsHeaderWriter:130 - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@345b7ee0
2017-05-11 16:19:09 DEBUG FilterChainProxy:325 - /resources/js/jquery-3.2.1.min.js at position 4 of 12 in additional filter chain; firing Filter: 'CsrfFilter'
2017-05-11 16:19:09 DEBUG FilterChainProxy:325 - /resources/js/jquery-3.2.1.min.js at position 5 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2017-05-11 16:19:09 DEBUG AntPathRequestMatcher:137 - Request 'GET /resources/js/jquery-3.2.1.min.js' doesn't match 'POST /logout

Jak skonfgurować log4j aby archiwizował tylko moje logi?

1

https://dzone.com/tutorials/java/log4j/log4j-example-multiple-appender.html
W skrócie:

ustawiasz tutaj logger level np. INFO, WARN

log4j.appender.file.Threshold =

0

po ustawieniu m.in na fatal nie widze roznicy..

0

ok juz zrozumialem sowj blad

1 użytkowników online, w tym zalogowanych: 0, gości: 1