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

How can I create a zip archive from a log4j log file automatically?
Log4j - write the same data (same level) (for example all INFO LOGS) to both stdout & logfile
How to disable log4j default logging?
TIBCO MDM 9 : log4j:WARN No appenders could be found for logger (RulebaseCustomFunction)
Log4J DailyRollingFileAppender file name
How to configure JDBCAppender programmatically
how to use markerfilter with old log4j
How to setup log rotation in AEM web console?
Websphere 8.5.3, SLF4j Log4j, Multiple EARs, multiple log files not generating
How to configure logging level for JAWR using log4j.xml
In which classes we are not using Log4J
log4j - why am I getting this ludicrous amount of DEBUG even if there's no log4j.properties?
log4j 2.5 Rolling file appender does not release lock on files with Delete feature
configure log4j in dockerfile
No logs when tomcat is stopped
log4j doesn't print preparestatement sql log

Categories

HOME
wso2-am
webpack
urbancode
deezer
push-notification
nullpointerexception
comparison
hashmap
session
relayjs
cvs
jira
yarn
windows-server
serverspec
networkx
swagger-ui
dax
timeout
windows-server-2012
libtiff
django-cms
shared-hosting
google-pagespeed
cultureinfo
cas
pingfederate
sql-server-2012-express
tinymce-4
vsts-build-task
protovis
dosbox
simplexml
git-merge
automake
libraries
streamsets
service-discovery
reportbuilder
angularjs-factory
cookiecutter-django
ensembles
google-closure
nxlog
galleria
parentheses
prolog-setof
pebble-watch
fancybox-2
statsd
knockout-components
namecoin
sts-springsourcetoolsuite
elements
home-directory
gridview-sorting
angstrom-linux
sigabrt
ford-fulkerson
kendonumerictextbox
pervasive-sql
srand
intellij-14
metaclass
comobject
varargs
emailrelay
operation
qpainter
asp.net-dynamic-data
nsbutton
websocket4net
document-classification
android-radiobutton
contenttype
cdc
sitemesh
typoscript2
bitsharp
funscript
cascalog
uiviewanimation-curve
punbb
assembly-loading
fireworks
mercurial-server
window-management
javax.script
gdlib
mysql-error-1005
sudzc
subviews
asp.net-mvc-areas
.nettiers
jquery-ui-droppable
webkit.net
kdbg
commodore

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