Log taglib ver. 1.7

    Custom JSP tag. Provides a generic support for logging (tracing) in your JSP pages. Tag setLogFile describes a log file and a body tag logData writes own body into defined log. For example:
 


<%@ taglib uri="taglib.tld" prefix="log" %>

<log:setLogFile fileName="c:/mylog.txt" id="A" />
...
<log:logData id="A">
   This line will be saved in the log file associated with ID A
</log:logData>

setLogFile defines an application level ID. So you may use this tag for example only once per your application. logData tag uses one of described ID's for writing data into associated file. You may use also setLogState tag for switching logging process on and off. If the current state for some of ID's is switched off, logData tag uses this ID just skips own body.

Attribute cond lets you skip logging regardless of the global state.

Tags are:

setLogFile

Describes log file and an associated ID. Parameters are:

1) fileName Optional parameter. Describes a path to your log file. By default system log will be used.
2) id ID associated with this file

setLogState

Describes log's state (on/off). Parameters are:

1) id log's ID
2) state log's state. Possible values are on or off. Default value is on.

logData

Body tag, writes own body into log file. Tag just skips own body if the current log's state is off. Parameters are:

1) id log's ID
2) cond Optional attribute. Describes a boolean value tag's behavior depends on. Default value is true (log data).

for downloading:

Library: logtag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also JSOS - the largest collection of servlets and filters.

     

Also in JSOS: