Broadcast on Broadcast off
The Documentation for Project Zero has moved. Please update your bookmarks to: http://www.projectzero.org/documentation/
Table of
Contents...
Hide

Project Zero Developer’s Guide

Basic concepts
Core concepts overview
Event processing
Writing Java handlers
Writing Groovy handlers
Firing events
Global Context
Global Context reference
Application directory layout
Virtualized directories
Writing rich Web applications
Features and configuration
Configuration
Debugging
Dependencies
Packaging
Application Classpath
Logging and tracing
RESTful resources
Creating RESTful documentation
File serving
Response rendering
Validators and validation
HTTP error handling
Client programming with Dojo
Runtime Options
Deployment modifications
HTTP configuration
SSL configuration
Proxy configuration
Security
Security considerations
Authentication
Extending security
Security Tokens
Token support
Extending token support
Leveraging TAI
User service
File based user service
LDAP user service
Extending user service
Security Utilities
Leveraging XOREncoder
Assemble
Calling Out to a Remote Resource
Using the Connection API
Sending an email
Configuring destinations
Configuring protocols
Protocol reference
HTTP protocol
SMTP protocol
File protocol
Event protocol
Assemble Flows and Mediations
Using flows
Getting started with Assemble flow
Creating a simple feed flow
Creating a simple Assemble flow
Creating a simple extension
Problem determination
A Flow language example
Creating and running a new flow
Writing flows using a Groovy DSL
Creating new flow activities
Writing extensions in the flow language
Writing extensions in Groovy
Adding validation rule
Configuring the graphical tool
Using the GUI to work with flows
Feed perspective of the GUI tool
Advanced Features
Using the flow samples
Flow language reference
Flow language behavior and syntax
Running processes and activities
Built-in activities
Extension activities
Feed Operators
XML Operators
Using mediations
Configuring mediations
Creating new mediations
Supplied mediation steps
Static router
Java logger
XPath logger
REST2SOAP
Extensions
Atom support
Atom Enabling a Database
RSS support
JSON support
XMLEncoder
URIUtils
Developer Web tools
Data access
Common query patterns
Advanced query patterns
Update patterns
Local database transactions
Extending data access
Config vendor differences
PHP data access
Resource Model
Setup and configuration
Resource Model declaration
Programmatic Model API
HTTP REST API
Active content filtering support
Default filters
Custom filters
Other Extension Modules
Amazon E-Commerce Service
Reference
Zero command line interface
JavaDoc - Public API
JavaDoc - Public SPI
JavaDoc - All Classes
Samples and services
Samples
The Zero Zone Application
Services
Blogging service
Commenting service
File sharing service
Group service
Profile service
Rating service
Tagging service
Catalog Zero

 

Logging and tracing

Zero applications use the java.util.logging package for log and trace functions. Log and trace configurations are specified in the <appHome>/config/logging.properties file. This file is read and applied automatically by Zero if it is present.

Java logging consists of two principle components: Loggers (sources) and Log Handlers (sinks). Verbosity of each of these components may be controlled through log Level settings.

Default log and trace settings

Default settings for Zero applications use a "log" and console for important messages and a "trace" to include detailed messages. Specifically:
  • Logs and console contain messages of level INFO and above. Logs are written to a rotating output file in the <appHome>/logs directory; error-log-0 is the most recent file.
  • Trace contains messages of level INFO and above. Trace is also written to a rotating output file; <appHome>/logs/trace-log-0 is the most recent file. Trace includes Java exception stack trace details.

Loggers

Loggers are instantiated within application and platform code. For example, in Java code:
    Logger logger = Logger.getLogger("fully.qualified.class.name");

Loggers source LogRecords via Logger APIs or Zero's LogHelper API.

Level settings

Two log levels are compared to determine whether a logging API invocation sources a LogRecord:
  1. Logger level -- Level associated with the logger; specified in logging.properties
  2. API-invocation level -- Level specified in the API invocation (e.g. LogHelper.log(logger, Level.WARNING, ...) )

A logging API invocation sources a LogRecord only if the Logger level is equal or greater than the API-invocation level.

For example, the default Logger level for all Loggers is set in logging.properties as follows:

.level=INFO

One could also set Logger levels for specific Loggers by specifying the package or fully-qualified class name. For example:

# Applies to all loggers under package "fully.qualified"
fully.qualified.level=INFO

# Applies to the class "fully.qualified.class.name"
fully.qualified.class.name.level=INFO

Log handlers

Log handlers are specified in the logging.properties file. Each handler has an associated log level that controls which LogRecords are handled; others are ignored.

# This log handler handles only LogRecords at level WARNING and above;
# Others are ignored
zero.core.logging.LogHandler.level=WARNING

Logging from Groovy scripts

See the Groovy handlers page for details.

Access Logging

Zero provides the ability to log all http requests via access logging. By default access logging is disabled. To enable access logging add the following line tothe <apphome>/config/zero.config file:

[/config]
accessLogging=true

When enabled the <apphome>/logs/access-log will be created. Access log entries will have the format:


   <hostname or IP>   [<local time>]  <http method> <Request URI> <status code> <bytecount>

r13 - 26 Oct 2007 - 09:56:26 - cjthorne
Syndicate this site RSS ATOM
Copyright 2007 © IBM Corporation | Privacy | Terms of Use | About this site