Comments (7)
Hi and welcome!
Did you just download Jar from Maven Central Repo? Is there any reason you are not using Maven to handle dependencies?
Please answer following:
- Do you have a graylog2 server running and is configured to use AMQP queues?
- Is log4j working at all?
- Please share
log4j.properties
orlog4j.xml
file contents
The how-to Wiki page was a bit out of date. Please refer to https://github.com/t0xa/gelfj/blob/master/README.md for all configuration options.
Thanks
from gelfj.
Hi,
yes, I downloaded the Jar form Maven Central Repo. Yes, unfortunately...
- Yes, my graylog2 server is running. I can send a message like:
echo '{"version": "1.1","host":"lab.lnix.de","short_message":"A short message that helps you identify what is going on","full_message":"Backtrace here\n\nmore stuff","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}' | nc -w 1 -u graylog.lnix.de 12201
-
Yes, log4j is working on my amq server
[...]
log4j.rootLogger=INFO, graylog2
log4j.appender.graylog2=org.graylog2.log.GelfAppender
log4j.appender.graylog2.graylogHost=graylog.lnix.de
log4j.appender.graylog2.originHost=lab.lnix.de
log4j.appender.graylog2.facility=gelf-java
log4j.appender.graylog2.layout=org.apache.log4j.PatternLayout
log4j.appender.graylog2.extractStacktrace=true
log4j.appender.graylog2.addExtendedInformation=true
log4j.appender.graylog2.additionalFields={'environment': 'DEV', 'application': 'MyAPP'}
[...]
Thanks.
from gelfj.
Hi,
The configuration looks good. May I suggest you try latest library version - 1.1.12 @ https://search.maven.org/remotecontent?filepath=org/graylog2/gelfj/1.1.12/gelfj-1.1.12.jar
I also highly recommend to use Maven or Gradle to handle all your dependencies.
Let me know how it will works.
Regards,
Anton
from gelfj.
Hello Anton,
I replace the gelf jar to 1.1.12 in my classpath but it doesn't work. Following points are different of my configuration:
- I rename gelfj-1.1.12.jar to karaf-gelfj-1.1.12.jar
- I added my graylog settings to org.ops4j.pax.logging.cfg and not log4j.properties
Is this a problem?
Did I add the karaf-gelfj-1.1.12.jar to my startup.properties?
Regards
lnix
from gelfj.
Hello Anton. I get the following errors:
./karaf server
Please wait, JBoss A-MQ is initializing...
7% [=====> ]log4j:ERROR Could not instantiate class [org.graylog2.log.GelfAppender].
java.lang.ClassNotFoundException: org.graylog2.log.GelfAppender not found by org.ops4j.pax.logging.pax-logging-service [4]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.apache.log4j.helpers.Loader.loadClass(Loader.java:198)
at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:326)
at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:123)
at org.apache.log4j.PaxLoggingConfigurator.parseAppender(PaxLoggingConfigurator.java:97)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
at org.apache.log4j.PaxLoggingConfigurator.doConfigure(PaxLoggingConfigurator.java:72)
at org.ops4j.pax.logging.service.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:214)
at org.ops4j.pax.logging.service.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServiceImpl.java:362)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1747)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)
at java.lang.Thread.run(Thread.java:744)
log4j:ERROR Could not instantiate appender named "graylog2".
100% [========================================================================]
from gelfj.
Hi @lnix1988, Looking at the message the library is still not found in the classpath.
from gelfj.
which library? The jar file (karaf-gelfj-1.1.12.jar) is in my classpath. I can see it with ps aux |grep java |grep karaf-gelfj-1.1.12.jar
from gelfj.
Related Issues (20)
- Please publish sources to maven central HOT 5
- regular jar also contains dependencies HOT 3
- GelfAppender does not support JSON message parsing into additional fields HOT 5
- Add context to gelf message? HOT 2
- problem with send log from log4j2 to graylog2 via gelfj
- GelfHandler does not implement Handler interface correctly
- Curly Braces around Position parameter String leads to exception in GelfHandler
- log4j method not found HOT 1
- Invalid timestamp HOT 11
- 1.1.15 causes "Invalid Bundle-ManfestVersion 1" in Karaf 4 HOT 2
- Support arrays HOT 2
- [question] Which build tool is recommended for this project?
- [need_help] graylog2 appender not send data to host:port. HOT 3
- Missing setter on GelfHandler for multiple additional fields
- NullPointerException if only amqp is defined
- [MacOsX] compilation fails both for master and v1.1.16 on OpenJDK v.11
- log4j:ERROR Error during sending GELF message. Error code: 11.
- is GELF J affected via log4j 2 vulnerability? HOT 2
- Gelf chunk message ID is not unique HOT 4
- Couldn't send message to graylog HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gelfj.