[#BloombergLP-ball-FileObserver-enableFileLogging-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver.adoc[FileObserver]::enableFileLogging
:relfileprefix: ../../../
:mrdocs:

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`&period; Return 0 on success, a positive value if file logging is already enabled (with no effect), and a negative value otherwise&period; If the `appendTimestampFlag` is `true` and `logFilenamePattern` does not contain any `%`&hyphen;escape sequences, this method behaves as if &quot;&period;%T&quot; is appended to `logFilenamePattern`&period;

== Synopsis

Declared in `&lt;ball&lowbar;fileobserver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
enableFileLogging(
    char const* logFilenamePattern,
    bool appendTimestampFlag);
----

== Description

DEPRECATED&colon; Use `enableFileLogging(logFilenamePattern)` instead (use the &quot;&period;%T&quot; pattern to replicate `true &equals;&equals; appendTimestampFlag` behavior)&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
