GithubHelp home page GithubHelp logo

log4j2-elasticsearch-examples's People

Contributors

rfoltyns avatar udemaddalena avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

log4j2-elasticsearch-examples's Issues

Cannot be compiled with Java 8 anymore

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.

log4j2.yml not working

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.