log4j


logging to ELK stack from karaf


I've been working on getting an ELK stack setup to have our logs centralized and easier to check, but I'm running into a bit of a snag.
I've modified a few of our java programs to use the socket appender from log4j and it's worked great each time. Now I'm trying to add it to karaf to have all of our karaf logs recorded but it doesn't seem to be working.
I added:
log4j.rootLogger=INFO, logstash, osgi:*
# Logstash appender
log4j.appender.logstash=org.apache.log4j.net.SocketAppender
log4j.appender.logstash.Port=PORT
log4j.appender.logstash.RemoteHost=HOST
log4j.appender.logstash.ReconnectionDelay=10000
to the file in {karaf_home}/etc/org.ops4j.pax.logging.cfg (with the correct port/host obviously) and then restarted karaf just to make sure (something I read said it would pick up changes automatically but I didn't know if I trusted it so I restarted it anyway) but nothing seems to be making it from karaf to our ELK stack. When I do log:display on the karaf console I see plenty of messages being written to the log, but none in ELK.
Any clue as to why this may not be working for karaf, but is working for other projects using the same appender?
You should have a look at karaf decanter. It already contains connectors that can be used to send logs to an ELK stack, the decanter-collector-log is probably what you are looking for

Related Links

Log4j don't catch javax.el exception
'infinispan-core' not showing logs
Tomcat log each application into separate file
slf4j-log4j bridge with log4j 2.8.1
logging to ELK stack from karaf
Changing Log4J configuration in Tibco BW/Designer does not have the desired effect
Write to SYSLOG with RootLogger OFF
How to write separate log files for each error transactions in Java using log4j
log4j on jboss - subpackage level
converting log4j into log4j2. With RollingFileAppender, size and file name pattern
Log4j NoSQL/Mongo appender in Tibco BusinessWorks 5
jcl104-over-slf4j version 1.4.2 is safe to be replaced by jcl-over-slf4j 1.7.2
Log4j2 main ERROR AmazonRollingRandomAccessFile contains an invalid element or attribute
Is it possible to set an SMTP header in SMTPAppender?
log4j rotate and compress files
Log4J 2 failing to configure

Categories

HOME
omnet++
v8
ckeditor
retrofit
baqend
add
facebook-messenger-bot
session-variables
adobe-analytics
wheelnav.js
rascal
mapserver
postgres-xl
zend-framework3
remote-access
jsprit
iolanguage
django-simple-history
reactcsstransitiongroup
database-replication
jqwidget
karma-jasmine
conemu
abi
facebook-instant-articles
kvc
chromium-embedded
bootstrap-tour
dxf
sqlcipher
vlsi
centos6.5
status
applozic
replaceall
webkitspeechrecognition
bpel
google-rich-snippets
xquery-3.0
pdb
amazon-kinesis-kpl
mmenu
wpf-controls
reportbuilder
graphenedb
pdf-reactor
node-gyp
nomethoderror
heightmap
sencha-touch-2.3
komodoedit
pillow
quartz-composer
gnome-shell-extensions
migradoc
word-vba-mac
xcb
radtreelist
database-optimization
pcf
paypal-express
lttng
fadeout
hexdump
javax.sound.midi
retina
simple-framework
citrus-pay
emailrelay
mono-embedding
key-management
apache-commons-net
offloading
c3
wordpress-theme-customize
client-side-templating
terminfo
google-reader
starcluster
elliptic-curve
balanced-payments
floating-point-precision
ril
dataadapter
pushbackinputstream
pvrtc
unc
manchester-syntax
spring-portlet-mvc
external-accessory
coredump
hamachi
xmemcached
appendto
telerik-scheduler
site.master
.nettiers
suppress
uimenucontroller
port-number
ajax-forms

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App