WriteLog()
Writes a message to a log file.
WriteLog( text=string, type=string, application=boolean, file=string, log=string );
Returns: void
| Argument | Description |
|---|---|
|
text
string,
required
|
edit
Message text to log. |
|
type
string,
optional
|
edit
Type (severity) of the message:
|
|
application
boolean,
optional
|
edit
log application name, if it is specified in a cfapplication tag. |
|
file
string,
optional
|
edit
Message file. Specify only the main part of the filename. For example, to log to the Testing.log file, specify "Testing". The file must be located in the default log directory. You cannot specify a directory path. If the file does not exist, it is created automatically, with the suffix .log. |
|
log
string,
optional
|
edit
If you omit the file argument, writes messages to standard log file. Ignored, if you specify file argument.
|
Examples
edit writeLog(log="MyLog", text=now(), type="error");
See also
- Debugging
- Console logging using SystemOutput
- Logging
- <cflog>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)