Skip to content

Instantly share code, notes, and snippets.

@chetanmeh
Created August 19, 2012 13:38
Show Gist options
  • Save chetanmeh/3394870 to your computer and use it in GitHub Desktop.
Save chetanmeh/3394870 to your computer and use it in GitHub Desktop.
Pax runner example demonstrating Logging
#This is a Pax Runner config file which uses Felix ConfigAdmin, Pax Logging and other bundles to
#demonstrate how to configure pax logging.
#It uses File install bundle and configures it to watch the config folder. We would add org.ops4j.pax.logging.cfg
#file to this folder which would then be picked by File install and thus update Pax logging config
--platform=felix
--vmOptions=-Dorg.osgi.service.http.port=9090 \
-Dfelix.fileinstall.dir=../config
#List of profiles to run
--profiles=log,felix.webconsole,felix.config,compendium
scan-bundle:mvn:org.apache.felix/org.apache.felix.metatype/1.0.4
scan-bundle:mvn:org.apache.felix/org.apache.felix.fileinstall/3.2.4
# Root logger option
log4j.rootLogger=INFO, file
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=../logging.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment