org.apache.cocoon.acting
Class LogAction

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.acting.AbstractAction
          extended byorg.apache.cocoon.acting.LogAction
All Implemented Interfaces:
org.apache.cocoon.acting.Action, ThreadSafe

public class LogAction
extends org.apache.cocoon.acting.AbstractAction
implements ThreadSafe

A simple Action that logs a given message for a given log level.

Parameters:

 level (optional):   Indicates the log level, defaults to 'info'
 console (optional): Indicates weather the message is also print to console, defaults to 'false'
 message (optional): The message to log, defaults to 'No log message given'
 

Sitemap definition:

 <map:action name="log" src="org.apache.cocoon.acting.LogAction"/>
 

Example use:

 <map:match pattern="some-resource">
 
   <!-- do something else -->
 
   <map:act type="log">
     <map:parameter name="level" value="info"/>
     <map:parameter name="message" value="Log message from sitemap action"/>
     <map:parameter name="console" value="true"/>
   </map:act>
 
   <!-- do something else -->
 
 </map:match>
 

Version:
$Id: LogAction.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
LogAction()
           
 
Method Summary
 Map act(org.apache.cocoon.environment.Redirector redirector, org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, Parameters par)
          A simple Action that logs a given message for a given log level.
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogAction

public LogAction()
Method Detail

act

public Map act(org.apache.cocoon.environment.Redirector redirector,
               org.apache.cocoon.environment.SourceResolver resolver,
               Map objectModel,
               String src,
               Parameters par)
        throws Exception
A simple Action that logs a given message for a given log level.

Specified by:
act in interface org.apache.cocoon.acting.Action
Throws:
Exception


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.