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

Deploy three projects on the same Weblogic domain. But the log4j write all the logs in one file
Log4j 1.2.17 - How to do log rolling based on size
Apache Kafka 0.8 log4j2.xml appender getting timeout error
Flink with High-availability with zookeeper: Submitted job is not acknowledged by Job manager
SoapUI does not change log file name/path after changes in soapui-log4j.xml
How to export lo4j from Ambari?
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

Categories

HOME
vim
amazon-ec2
path-finding
iot
cplex
rsync
jsrender
binary-tree
survey
callback
datastax-java-driver
export-to-csv
nstableview
phaser
uitypeeditor
telephony
foselasticabundle
aurigma
reactive-cocoa
database-replication
jqwidget
clickonce
excel-2007
restful-authentication
claims-based-identity
maxmind
maquette
buck
webkitspeechrecognition
vision
nouislider
yadcf
jspresso
phpfreechat
azure-sql-database
sequential
disassembling
scaffold
c11
xenforo
temporary-files
dism
no-www
flashair
slick-3.0
wptoolkit
angular-resource
long-polling
azure-application-gateway
pango
rails-routing
jquery-validate
veracode
colorama
composite-key
pg-dump
snmptrapd
color-profile
mediaelement
yt-project
jquery-filter
mikroc
websitepanel
lttng
holder.js
actionbardrawertoggle
hover-over
captivenetwork
ios4
rtbkit
ios8-today-widget
srand
t4mvc
nsmutabledictionary
cdt
mesa
aapt
rtmfp
didselectrowatindexpath
cloud-connect
srs
monomac
openlaszlo
aqtime
sitemesh
blending
file-locking
eventlistener
typoscript2
labwindows
getmessage
online-compilation
gwt-ext
calling-convention
celltable
dmx512
icanhaz.js
getresponsestream
forums
nsviewanimation
thunderbird-lightning
database-management
anti-piracy

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