Developing Apama Applications > Developing Apama Applications in EPL > Using Correlator Plug-ins in EPL > Using the Log File Manager plug-in > Plug-in functions
Plug-in functions
This section describes the functions provided by the Log File Manager plug-in. The next section describes the events that you route to the LoggingManager monitor in order to call these functions.
Before using any of the functions you should define a variable of type chunk and then pass it to each method. If the variable is local it should be initialized with new chunk, though this is not necessary for globals or event members.Since plug-ins are by definition stateless, this mechanism is required to preserve state (such as the log file’s name and location) across function calls.
init
boolean init (
   string filename,
   boolean append,
   chunk state)
Initialize the Log File Manager plug-in. Set the filename parameter to indicate the path and filename of the file to use, set append to true if you wish to continue using an existing log file or set to false to recreate/overwrite it. You can set filename to the special keyword "stdout" to log to standard output, and "stderr" to log to standard error. What this method does is encode these parameters into the state chunk, so that you can then pass it to all the other functions. Returns false if successful, true otherwise.
setLevel
boolean setLevel (
   chunk state,
   string level)
Set the current logging level. You can set level to one of "trace", "debug", "info", "warn", "error", or "fatal"— in order of increasing priority. Only log messages at the current priority level or higher will be output. This property is encoded within the state chunk. Returns false if successful, t rue otherwise.
setFormat
boolean setFormat(
   chunk state,
   string format)
Set the current log output format. You can set format to either "normal" or "csv". The former will print out regular logging messages, while the latter will apply special comma-separated format to the log output. The comma-separated format is particularly useful for loading the logging output into a spreadsheet or database for further analysis. Returns false if successful, true otherwise.
trace
trace(
   chunk state,
   string message)
Log message at the trace level.
debug
debug(
   chunk state,
   string message)
Log message at the debug level.
info
info(
  chunk state,
  string message)
Log message at the info level.
warn
warn(
  chunk state,
  string message)
Log message at the warn level.
error
error(
  chunk state,
  string message)
Log message at the error level.
fatal
fatal(
  chunk state,
  string message)
Log message at the fatal level.
logAt
logAt(
   chunk state,
   string levelAt,
   string message)
Log message at the level specified by the levelAt parameter. This can be one of "debug", "info", "warn", "error", or "fatal".
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.