[#BloombergLP-ball-LoggerManager-allocateLogger-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]::allocateLogger
:relfileprefix: ../../../
:mrdocs:

Allocate a logger with the specified raw observer and record buffer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Logger.adoc[Logger]*
allocateLogger(
    xref:BloombergLP/ball/RecordBuffer.adoc[RecordBuffer]* buffer,
    xref:BloombergLP/ball/Observer.adoc[Observer]* observer);
----

== Description

Return the address of a modifiable logger managed by this logger manager having the specified `observer` that receives published log records and configured with the specified record `buffer`&period; Optionally specify a `scratchBufferSize` for the logger&apos;s user&hyphen;accessible message buffer&period; If `scratchBufferSize` is not specified, the value configured at construction is used&period; Note that this method is primarily intended for use in multi&hyphen;threaded applications, but can be used to partition logging streams even within a single thread&period; Also note that ownership of `buffer` and `observer` is _not_ transferred, and hence, will _not_ be destroyed (or otherwise affected) after the logger is deallocated&period;

DEPRECATED&colon; Use the `allocateLogger` 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

address of a modifiable logger managed by this logger manager

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| record buffer used to configure the logger
| *observer*
| observer that receives published log records
|===


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