1. Warning message
Error output message.
log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Solution:
2.1 No log4j dependency is introduced
Insert the following code in the pom.xml file.
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
Configure the log4j.properties file and put this folder under Src/main/resources
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=5
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
perhaps
# Set root category priority to INFO and its only appender to CONSOLE.
#log4j.rootCategory=INFO, CONSOLE debug info warn error fatal
log4j.rootCategory=debug, CONSOLE, LOGFILE
# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %-6r [%15.15t] %-5p %30.30c %x - %m\n
# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=d:\axis.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{ISO8601} %-6r [%15.15t] %-5p %30.30c %x - %m\n
Read More:
- log4j:WARN No appenders could be found for logger (freemarker.cache)
- log4j Error: Please initialize the log4j system properly [How to Solve]
- [Solved] Spark Error: ERROR StatusLogger No log4j2 configuration file found
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- [Solved] Maven log jar package conflict error: Class path contains multiple SLF4J bindings
- [Solved] Initialization error encountered by JUnit unit test: Method initialization error not found
- Log4j2 reports ERROR StatusLogger Unrecognized format specifier
- JMeter JDBC Error: No pool found named: ‘test‘ [How to Solve]
- Log jar package conflict error: Class path contains multiple SLF4J bindings
- [Solved] Arm Server kibana7.4.1 Error: Sending Logstash logs to /home/logstash-6.8.4/logs which is now configured via log4j2.properties
- [Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
- [Solved] Phone Debug Program Error: The application could not be installed: INSTALL_FAILED_TEST_ONLY
- [Solved] Fabric 2.x: error starting container: API error (404): network_test not found
- [Solved] Neo4j error: Import-Module & neo4j Neo.ClientError.Security.Unauthorized
- [Solved] volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
- [Solved] Bringing up interface eth0: Error: No suitable device found: no device found for connection ‘System eth0’.
- [Go] Testing when solving go test: warning: no tests to run
- [Solved] sparkSQL Error: WARN TaskMemoryManager: Failed to allocate a page (bytes), try again.
- [neo4j] error report when visiting neo4j in spring boot project
- Chart.js Error: “Canvas is already in use. Chart …must be destroyed before the canvas can be reused”