I. introduction
When running Kafka related procedures of spark # project, it was warned that although it did not affect the operation, OCD looked very uncomfortable, so it was cleared immediately.
ERROR StatusLogger No log4j2 configuration file found.
Using default configuration: logging only errors to the console.
II. Problem-solving
1. Add log4j2.xml
Level can be configured in loggers
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss} [%t] %-5p %c{1}:%L - %msg%n" />
</Console>
<RollingFile name="RollingFile" filename="log/test.log"
filepattern="${logPath}/%d{YYYYMMddHHmmss}-fargo.log">
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss} [%t] %-5p %c{1}:%L - %msg%n" />
<Policies>
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
<DefaultRolloverStrategy max="20" />
</RollingFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console" />
<AppenderRef ref="RollingFile" />
</Root>
</Loggers>
</Configuration>
2. Add location
Add it to the Src/main/Resources folder and execute MVN install
3. Display
Since the level in the file is set to info, you can see many related logs and modify them yourself
Read More:
- Log4j2 reports ERROR StatusLogger Unrecognized format specifier
- [Solved] Junit.test use error: log4j:WARN No appenders could be found for logger
- 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: org.apache.spark.SparkException: A master URL must be set in your configuration
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- Log jar package conflict error: Class path contains multiple SLF4J bindings
- [Solved] Maven 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
- rsyslog Write into Log File Error [How to Solve]
- [Solved] Jmeter Error: Error loading results file – see file log
- [Solved] Neo4j error: Import-Module & neo4j Neo.ClientError.Security.Unauthorized
- [Solved] Latex&VScode Error: I found no bibdata command//command//citation—while reading file*.aux
- [error record] Android application release package error handling (turn off syntax check log processing release configuration)
- [Solved] Adb Shell Monkey Warning: can‘t create log.txt, Read-only file system
- [Solved] Bringing up interface eth0: Error: No suitable device found: no device found for connection ‘System eth0’.
- Maven configuration error: JAVA_HOME not found in your environment
- Cmake Compile opencv error: The system is: Windows – 10.0.19042 – AMD64 (Log File)
- [Solved] kafka Startup Error: ERROR Shutdown broker because all log dirs in /…/kafka/logs have failed (kafka.log.LogManager)
- [Solved] import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory