[#BloombergLP-ball-LoggerManager-initSingleton-0bd]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]::initSingleton
:relfileprefix: ../../../
:mrdocs:

Initialize the logger manager singleton with the given observer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]&
initSingleton(
    xref:BloombergLP/ball/Observer.adoc[Observer]* observer,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* globalAllocator = 0);
----

== Description

Initialize the logger manager singleton having the specified `observer` that receives published log records&period; Optionally specify a `configuration` describing how the singleton should be configured&period; If `configuration` is not specified, a default constructed `LoggerManagerConfiguration` object is used&period; Optionally specify a `globalAllocator` used to supply memory&period; If `globalAllocator` is 0, the currently installed global allocator is used&period; Return a non&hyphen;`const` reference to the logger manager singleton&period; This method has no effect (aside from logging a warning) if the logger manager singleton already exists&period; The behavior is undefined if `observer` is 0, goes out of scope, or is otherwise destroyed&period;

DEPRECATED&colon; Use the `initSingleton` method that does not take a _raw_ pointer to an `observer`, together with the `registerObserver` method (which takes a _shared_ pointer to an `observer`), instead&period;

== Return Value

non&hyphen;`const` reference to the logger manager singleton

== Parameters

[cols="1,4"]
|===
| Name| Description
| *observer*
| observer that receives published log records
| *globalAllocator*
| memory allocator&semi; null uses the global
|===


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