Application Programming Interface Guide > Built-in Procedures > Procedures Reference > LogMessageToFile
 
LogMessageToFile
Write the contents of a message to a file at a specified path.
Location
/lib/services/
Inputs
element: An XML document or element.
filePath: The path of the file to write log messages to. The path is relative to the log directory of the server.
fileMode: OVERWRITE or APPEND. OVERWRITE indicates that the message should overwrite the current contents of the file. APPEND indicates that the message should be appended to the end of the file.
header: If present, this value is written to the file immediately before the message contents. It may be NULL.
footer: If present, this value is written to the file immediately after the message contents. It may be NULL.
prettyPrint: If true, the message is indented to make it easier to read.
Output
element: The modified XML document or element.
Exceptions
IllegalArgumentException: If any of the arguments are invalid.
ServerException: If an error occurs while writing to the file.