Jämförda versioner

Nyckel

  • Dessa rader lades till.
  • Denna rad togs bort.
  • Formateringen ändrades.

...

Eftersom virtualiseringsplattformen är baserad på Mule används mekanismerna i Mule för att styra loggning. Mule använder log4j vilket beskrivs i http://ricston.com/blog/?p=81. Ett förslag på log4j.properties är som följer

 

Kodblock
languagetext
# Default log level
log4j.rootCategory=INFO,file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=../logs/vp.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p %d [%t] %c: %m%n
################################################
# You can set custom log levels per-package here
################################################
# Apache Commons tend to make a lot of noise which can clutter the log.
log4j.logger.org.apache=WARN
# Shuts up some innocuous messages if using the JBPM transport
log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=ERROR
# Reduce startup noise
log4j.logger.org.springframework.beans.factory=WARN
# Mule classes
log4j.logger.org.mule=WARN
log4j.logger.com.mulesource=WARN
# Your custom classes
log4j.logger.se.skl.tp=WARN

 

För att styra loggnivåer i virtualiseringsplattformen är det alltså sista raden som ändras till INFO eller DEBUG. Loggningen skapas i en fil som heter vp.log och ligger i foldern logs under MULE_HOME. Man kan också styra hur Mule själv loggar som står beskrivet i Readme under logs i muledistributionen "Application-level logging is configured in the file "conf/log4j.properties" (by default all output is sent to the console). System-level logging is configured in the file "conf/wrapper.conf" (by default all output is sent to the file "logs/mule.log" Note that, unless the application is run in the foreground (i.e., not as a daemon), this means that while the application itself is configured to send its output to the console, the wrapper receives the console output and sends it to the log file. In addition to the application's output, the wrapper also sends any JVM-level or OS-level errors/warnings to the log file. This means that if the JVM crashes and automatically restarts (enabled by default), the time and cause of the crash will remain in the log file after the JVM restarts."