rfoltyns / log4j2-elasticsearch-examples Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I cloned the project and then ran 'mvn clean install' with java 8 on Windows and Linux, after which I received the following error:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for log4j2-elasticsearch examples 0.0.1-SNAPSHOT:
[INFO]
[INFO] log4j2-elasticsearch examples ...................... SUCCESS [ 0.316 s]
[INFO] log4j2-elasticsearch-jest-springboot ............... FAILURE [ 2.625 s]
[INFO] log4j2-elasticsearch-hc-springboot ................. SKIPPED
[INFO] log4j2-elasticsearch-hc-one-jar .................... SKIPPED
[INFO] log4j2-elasticsearch-ahc-one-jar ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.101 s
[INFO] Finished at: 2023-02-25T21:00:12+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.3:repackage (default) on project log4j2-elasticsearch-jest-springboot: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.0.3:repackage failed: Unable to load the mojo 'repackage' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.0.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
java Version: 1.8.0_352
maven Version: 3.9.0
The code compiles with Java 17, but the examples do not run.
When I am using NonEmpty Filter in log4j2.yml, there is error saying 2023-04-07 12:43:41,063 main ERROR JacksonJsonLayout contains an invalid element or attribute "NonEmptyFilter" 2023-04-07 12:43:41,357 restartedMain ERROR JacksonJsonLayout contains an invalid element or attribute "NonEmptyFilter"
But its working fine in log4j2.xml
Log4j2.yml:
Configuration: Appenders: Console: name: ConsoleAppender target: SYSTEM_OUT PatternLayout: pattern: "%d %highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green} [%t] %-c{1.} - %C{1.} - %M - %msg %n" Elasticsearch: name: elasticsearch IndexName: indexName: log4j2 JacksonJsonLayout: NonEmptyFilter: VirtualProperty: - name: log value: $${ctx:log:-} dynamic: true writeRaw: true - name: context value: $${ctx:context:-} dynamic: true writeRaw: true AsyncBatchDelivery: batchSize: 2000 deliveryInterval: 1000 JestHttp: serverUris: http://localhost:9200 XPackAuth: BasicCredentials: username: elastic password: elastic Loggers: Root: level: info AppenderRef: - ref: ConsoleAppender - ref: elasticsearch
Log4j2.xml:
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <Console name="ConsoleAppender" target="SYSTEM_OUT"> <PatternLayout pattern="%d %highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green} [%t] %-c{1.} - %C{1.} - %M - %msg %n"/> </Console> <Elasticsearch name="elasticsearch"> <IndexName indexName="log4j2"/> <JacksonJsonLayout> <NonEmptyFilter/> <VirtualProperty name="log" value="$${ctx:log:-}" dynamic="true" writeRaw="true"/> <VirtualProperty name="context" value="$${ctx:context:-}" dynamic="true" writeRaw="true"/> </JacksonJsonLayout> <AsyncBatchDelivery batchSize="2000" deliveryInterval="1000"> <JestHttp serverUris="http://localhost:9200/"> <XPackAuth> <BasicCredentials username="elastic" password="elastic" /> </XPackAuth> </JestHttp> </AsyncBatchDelivery> </Elasticsearch> </Appenders> <Loggers> <Root level="info"> <AppenderRef ref="ConsoleAppender"/> <AppenderRef ref="elasticsearch"/> </Root> </Loggers> </Configuration>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.