- Jetspeed utilizes the logging services provided by Turbine. The logfile(s) are
+ As og 1.4b5, Jetspeed Log4J for logging. The logfile(s) are
a valuable tool in trouble shooting problems and monitoring the general health of
Jetspeed an it's portlets.
+ The base configuration of the logging is set in the settings in JetspeedResources.properties shown below.
+ The details of the configuration is done in the file specified by log4j.properties.
+ The way Jetspeed logs, you are able to controlled logging very detailed, if you should need so.
+ Jetspeed defines a named logger for every single class that performs logging. Thus, you can configure it so
+ that a single class logs debug to its own file. This level of detail gives you better control when debugging!
+ The configuration shipped with Jetspeed is set up on a much coarser level initially.
+
+#########################################
+# JetspeedLogFactory Service #
+#########################################
+# If this file has extension properties, then log4j property configuration is done.
+# Otherwise DOM configuration for XML. Thus you can choose what format you like to use.
+log4j.properties=/WEB-INF/conf/log4j.properties
+# If true, Log4J will monitor the property file and reconfigure if changed.
+log4j.configureAndWatch=true
+# Number of ms between each property file check
+log4j.watchInterval=60000
+
+
+
The logging level should be set according the the current needs. DEBUG logging is
suggested during portlet testing, while INFO logging is appropriate for every-day
- activity in a stable environment.
+ activity in a stable environment. In heavy production systems, WARN is appropriate.
- Rotation of log files. This will limit the amount of disk space
- consumed by the log file. Not supported by all loggers. To enable this
- logger, you must replace "logforj" with "rotation" on the facilities list
- and set default logger to "rotation". Please check log4j documentation
- for information on various appenders that can be used here (i.e.
- RollingFileAppender vs. DailyRollingFileAppender).
-
-
-
-
debug
-
- This logger sends log messages to both console and log file. It is useful
- for testing and debugging but is not appropriate for production use.
- To enable this logger, you must add "debug" to the facilities list
- and set default logger to "debug".
-
-
-
-
schedule
-
- A facility for the scheduler service
- To disable started/stopped messages set the level to ERROR
-
-
-
-
security
-
- A facility for security audit. NOTE! As of 23 Jan 2001
- Turbine does not have any standard security auditing
- functionality. It's up to your application.
-
-
-
-
system
-
A facility for system logging.
-
-
-
sql
-
- A facility for SQL query logging
- To enable SQL query logging, set the level to DEBUG
-
-
-
-
-
- This is a logging service provide with Turbine.
-
- All loggers define in services.LoggingService.facilities must
- be the same type when using the Log4J services.
-
-
- When using log file rotation, the rotation facility must be the first in the
- services.LoggingService.facilities list and should replace the logforj
- facility.
-
Designates very severe error events that will presumably lead the application to abort.
-
-
-
ERROR
-
Designates error events that might still allow the application to continue running
-
-
-
WARN
-
Designates potentially harmful situations
-
-
-
INFO
-
Designates informational messages that highlight the progress of the application at coarse-grained level.
-
-
-
DEBUG
-
Designates fine-grained informational events that are most useful to debug an application
-
-
-
-
-
-
MaxFileSize
-
Approximate log file size in bytes. 1MB = 1048576 bytes
-
-
-
MaxBackupIndex
-
- Number of backup log files to maintain. The actual number of log files
- will be file.backups + 1.
-
-
-
-
This facility is useful to generate web server like access log which
@@ -476,10 +290,6 @@
Simple implementation using Apache Common Log Format (CLF)
-
services.PortletStats.logger = access
-
Name of the log4j logger
-
-
services.PortletStats.enabled = false
This service is disabled by default
@@ -492,125 +302,201 @@
Date format to use in the log entry
+
+ NOTE: In addition, the category/logger named "org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService"
+ in the Log4J configuration controls where the actual logging goes. This must be set to log at level INFO for
+ the portlet usage logger to be active.
+
- The following configuration will rotate the logging among 6 files. All logging
- will be at the DEBUG level.
+ The following configuration will log all general Jetspeed log to one file, all Jetspeed services to one, and all
+ logging from turbine to a third. In addition, the neccesary logger for the portlet usage is defined.
+ NOTE: If you remove the "{1}" behind the %c in the patterns in the configuration, you will get tha fully
+ qualified class name (i.e. including package name) in the log file. This might be useful.
# -------------------------------------------------------------------
+#
+# This file contains log4j-specifc logging properties. This file is
+# loaded by the logging service based on the following property
+# in JetspeedResources.properties:
#
-# L O G S
+# log4j.properties = ${webappRoot}/WEB-INF/conf/log4j.properties
#
-# -------------------------------------------------------------------
-# This is the configuration for the logging system. In most cases
-# you don't need to modify anything. However, if you wish to add more
-# facilities or modify the existing settings, then you can do so.
+# Appender specified in log4j.category.default must be the same as
+# the one specified in services.LoggingService.default property.
+#
+# All log4j properties should be supported. Check log4j documentation
+# for more information.
+#
+# Note that strings containing "," (comma) characters must backslash
+# escape the comma (i.e. '\,')
#
-# destination.file: A path relative to the web app root
# -------------------------------------------------------------------
-services.LoggingService.facilities=logforj,access
-services.LoggingService.default=logforj
-services.LoggingService.loggingConfig=org.apache.turbine.services.logging.PropertiesLoggingConfig
-
-# A facility for system logging.
-services.LoggingService.system.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.system.className=org.apache.turbine.services.logging.FileLogger
-services.LoggingService.system.level=DEBUG
-
-# A facility for the scheduler service
-# To disable started/stopped messages set the level to ERROR
-services.LoggingService.scheduler.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
-services.LoggingService.scheduler.level=DEBUG
-
-# A facility for debugging applications. Messages will go both
-# to the log file and the server console.
-services.LoggingService.debug.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.debug.destination.console=true
-services.LoggingService.debug.className=org.apache.turbine.services.logging.FileLogger
-services.LoggingService.debug.level=DEBUG
-
-# A facility for SQL query logging
-# To enable SQL query logging, set the level to DEBUG
-services.LoggingService.sql.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.sql.className=org.apache.turbine.services.logging.FileLogger
-services.LoggingService.sql.level=DEBUG
-
-# A facility for security audit. NOTE! As of 23 Jan 2001
-# Turbine does not have any standard security auditing
-# functionality. It's up to your application.
-services.LoggingService.security.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.security.className=org.apache.turbine.services.logging.FileLogger
-services.LoggingService.security.level=DEBUG
-
-# An example configuration for using Log4Java, with log4j properties inline
-# The category name - at the end of this line - needs to match the logging facility name - the first log4j.
-# need this rootCategory entry to capture the torque/fulcrum etc logging
-services.LoggingService.logforj.log4j.rootCategory = INFO, logforj
-
-# need this category entry for the actual jetspeed logging (I don't know why it doesn't get covered by the root category!)
-services.LoggingService.logforj.log4j.category.logforj = DEBUG, logforj
-
-services.LoggingService.logforj.log4j.appender.logforj.file =${webappRoot}/WEB-INF/log/jetspeed.log
-services.LoggingService.logforj.log4j.appender.logforj = org.apache.log4j.FileAppender
-services.LoggingService.logforj.log4j.appender.logforj.layout = org.apache.log4j.PatternLayout
-services.LoggingService.logforj.log4j.appender.logforj.layout.conversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - %m%n
-services.LoggingService.logforj.log4j.appender.logforj.append = false
-services.LoggingService.logforj.className=org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.logforj.level=DEBUG
-
-# An example configuration for portlet access audit logging
-services.LoggingService.access.log4j.category.access = INFO, access
-services.LoggingService.access.log4j.appender.access = org.apache.log4j.FileAppender
-services.LoggingService.access.log4j.appender.access.layout = org.apache.log4j.PatternLayout
-services.LoggingService.access.log4j.appender.access.layout.ConversionPattern = %m%n
-services.LoggingService.access.log4j.appender.access.append = true
-services.LoggingService.access.log4j.appender.access.file = ${webappRoot}/WEB-INF/log/access.log
-services.LoggingService.access.className = org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.access.level = INFO
-
-# An example configuration for automatic log rotation using Log4Java
-# This will keep the log file size under 1MB and save up to 5 backup copies
-services.LoggingService.rotation.log4j.rootCategory = INFO, rotation
-services.LoggingService.rotation.log4j.category.rotation = DEBUG, rotation
-
-services.LoggingService.rotation.log4j.appender.rotation.file = ${webappRoot}/WEB-INF/log/jetspeed.log
-services.LoggingService.rotation.log4j.appender.rotation = org.apache.log4j.RollingFileAppender
-services.LoggingService.rotation.log4j.appender.rotation.layout = org.apache.log4j.PatternLayout
-services.LoggingService.rotation.log4j.appender.rotation.layout.conversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - %m%n
-services.LoggingService.rotation.log4j.appender.rotation.append = false
-services.LoggingService.rotation.log4j.appender.rotation.MaxFileSize = 1024KB
-services.LoggingService.rotation.log4j.appender.rotation.MaxBackupIndex = 5
-services.LoggingService.rotation.className = org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.rotation.level = DEBUG
-
-# An example configuration for using *NIX syslogd with Log4Java
-services.LoggingService.syslog.destination.syslogd.host=my.syslog.server.com
-services.LoggingService.syslog.destination.syslogd.facility=LOG_DAEMON
-services.LoggingService.syslog.className=org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.syslog.level=INFO
-
-# An example configuration for using remote Log4Java server
-services.LoggingService.remote.destination.remote.host=my.remote.server.com
-services.LoggingService.remote.destination.remote.port=1099
-services.LoggingService.remote.className=org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.remote.level=INFO
-
-# An example configuration for sending error reports as email with Log4Java
-# notes:
-# * uses 'mail.server' as SMTP server to send mail through
-# * log4j will send the email when an ERROR is logged, with
-# 'buffer.size' previous (non-ERROR) logs included in the email
-# * configured to log to a file as well otherwise stacktraces are lost
-services.LoggingService.email.destination.file=/WEB-INF/log/jetspeed.log
-services.LoggingService.email.destination.email.from=root@localhost
-services.LoggingService.email.destination.email.to=root@localhost
-services.LoggingService.email.destination.email.subject=Jetspeed Error Report
-services.LoggingService.email.destination.email.buffer.size=512
-services.LoggingService.email.className=org.apache.turbine.services.logging.Log4JavaLogger
-services.LoggingService.email.level=INFO
+# The rootlogger means that all logging not defined otherwise, will go where it describes
+log4j.rootLogger = INFO, jetspeed
+# If debug = true, you will see how Log4J configures on the stdout of your webapp container
+log4j.debug = true
+#
+# Jetspeed goes into Jetspeed Log
+#
+log4j.category.org.apache.jetspeed = DEBUG, jetspeed
+log4j.additivity.org.apache.jetspeed = false
+
+#
+# Jetspeed services goes into Jetspeed Services Log
+#
+log4j.category.org.apache.jetspeed.services = DEBUG, jetspeedsrv
+log4j.additivity.org.apache.jetspeed.services = false
+# Setting CastorPsmlManagerService to higher level, as it is quite verbose on DEBUG
+log4j.category.org.apache.jetspeed.services.psmlmanager.CastorPsmlManagerService = INFO, jetspeedsrv
+log4j.additivity.org.apache.jetspeed.services.psmlmanager.CastorPsmlManagerService = false
+
+#
+# Turbine goes into Turbine Log
+# JetspeedLoggingService handles all logging thru TurbineLoggingService
+#
+log4j.category.org.apache.jetspeed.services.logging.JetspeedLoggingService = INFO, turbine
+log4j.additivity.org.apache.jetspeed.services.logging.JetspeedLoggingService = false
+
+#
+# Portlet access Category
+#
+log4j.category.org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService = INFO, access
+log4j.additivity.org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService = false
+
+#
+# Console output Category
+#
+log4j.category.stdout = INFO, stdout
+log4j.additivity.stdout = false
+
+########################################################################
+#
+# Logfile definitions
+#
+########################################################################
+
+#
+# jetspeed.log
+#
+log4j.appender.jetspeed = org.apache.log4j.FileAppender
+log4j.appender.jetspeed.file = ${webappRoot}/WEB-INF/log/jetspeed.log
+log4j.appender.jetspeed.layout = org.apache.log4j.PatternLayout
+log4j.appender.jetspeed.layout.conversionPattern = %d [%t] %-5p %c{1} - %m%n
+log4j.appender.jetspeed.append = false
+
+log4j.appender.jetspeedsrv = org.apache.log4j.FileAppender
+log4j.appender.jetspeedsrv.file = ${webappRoot}/WEB-INF/log/jetspeedservices.log
+log4j.appender.jetspeedsrv.layout = org.apache.log4j.PatternLayout
+log4j.appender.jetspeedsrv.layout.conversionPattern = %d [%t] %-5p %c{1} - %m%n
+log4j.appender.jetspeedsrv.append = false
+
+#log4j.appender.jetspeed = org.apache.log4j.RollingFileAppender
+#log4j.appender.jetspeed.file = ${webappRoot}/WEB-INF/log/rotation.log
+#log4j.appender.jetspeed.MaxFileSize = 50KB
+#log4j.appender.jetspeed.MaxBackupIndex = 5
+#log4j.appender.jetspeed.layout = org.apache.log4j.PatternLayout
+#log4j.appender.jetspeed.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - %m%n
+
+#
+# turbine.log
+#
+log4j.appender.turbine = org.apache.log4j.FileAppender
+log4j.appender.turbine.file = ${webappRoot}/WEB-INF/log/turbine.log
+log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
+log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c{1} - %m%n
+log4j.appender.turbine.append = false
+
+#
+# Portlet access Output
+#
+log4j.appender.access = org.apache.log4j.FileAppender
+log4j.appender.access.file = ${webappRoot}/WEB-INF/log/access.log
+log4j.appender.access.layout = org.apache.log4j.PatternLayout
+log4j.appender.access.layout.conversionPattern = %m%n
+log4j.appender.access.append = true
+
+#
+# Console Output
+#
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - %m%n
+
+
+
+ The following XML configuration shows a similar configuration in XML format. You can choose
+ your favorite format.
+