[#BloombergLP-ball-FileObserver-enableFileLogging-00] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver.adoc[FileObserver]::enableFileLogging :relfileprefix: ../../../ :mrdocs: Enable file logging, optionally appending a timestamp to the name. == Synopsis Declared in `<ball_fileobserver.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int enableFileLogging( char const* logFilenamePattern, bool appendTimestampFlag); ---- == Description Enable logging of all records published to this file observer to a file whose name is derived from the specified `logFilenamePattern` and append a timestamp to the log filename if the specified `appendTimestampFlag` is `true`. Return 0 on success, a positive value if file logging is already enabled (with no effect), and a negative value otherwise. If the `appendTimestampFlag` is `true` and `logFilenamePattern` does not contain any `%`‐escape sequences, this method behaves as if ".%T" is appended to `logFilenamePattern`. DEPRECATED: Use `enableFileLogging(logFilenamePattern)` instead (use the ".%T" pattern to replicate `true == appendTimestampFlag` behavior). == Return Value 0 on success, positive if already enabled, negative on error == Parameters [cols="1,4"] |=== | Name| Description | *logFilenamePattern* | filename pattern, possibly with `%`‐escapes | *appendTimestampFlag* | whether to append a timestamp to the filename |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#