[#BloombergLP-ball-FileObserver-setLogFormats] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver.adoc[FileObserver]::setLogFormats :relfileprefix: ../../../ :mrdocs: Set the format specifications for log records written to the log file and to `stdout` to the specified `logFileFormat` and `stdoutFormat`, respectively. If the default short output format is currently in effect for logging to `stdout`, this method has the effect of calling `enableStdoutLoggingPrefix` (see that method and `disableStdoutLoggingPrefix`) and setting the format corresponding to enabled `stdout` logging prefix to `stdoutFormat`. See {Log Record Formatting} for details on the syntax of format specifications. Return zero if both formats are valid and have been set. Otherwise, if either format is invalid, return a non‐zero value. If one of the formats is invalid, it will not be set, but the valid format will be set. Note that default formats are in effect following construction until a format‐setting method is called ("n%d %p:%t %s %f:%l %c %m %un" for both file and `stdout` logging). Also note that the default format 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. == Synopsis Declared in `<ball_fileobserver.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int setLogFormats( char const* logFileFormat, char const* stdoutFormat); ---- == Description DEPRECATED: Prefer `setFileLogFormat` and `setStdoutLogFormat`. [.small]#Created with https://www.mrdocs.com[MrDocs]#