[#BloombergLP-ball-FileObserver2-setLogFileFunctor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver2.adoc[FileObserver2]::setLogFileFunctor
:relfileprefix: ../../../
:mrdocs:

Set the formatting functor used when writing records to the log file&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setLogFileFunctor(xref:BloombergLP/ball/FileObserver2/RecordFormatter.adoc[RecordFormatter] const& logFileFunctor);
----

== Description

Set the formatting functor used when writing records to the log file of this file observer to the specified `logFileFunctor`&period; Note that a default format (&quot;n%d %p&colon;%t %s %f&colon;%l %c %m %un&quot;) is in effect until this method or `setFormat` is called&period; Also, notice that the observer emits newline characters at the beginning and at the end of a log record by default, so the user needs to add them explicitly to (text) format strings to preserve that behavior&period; Note that this method exists for backwards compatibility and new code is highly encouraged to make use of `setFormat` with the URI&hyphen;scheme&hyphen;like tags to create different formatters&period; (Currently string and JSON output format is supported&period;)

== Parameters

[cols="1,4"]
|===
| Name| Description
| *logFileFunctor*
| functor that formats records for the log file
|===


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