---
name: "ACE_Log_Msg_Callback"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Log_Msg_Callback"
---

# ACE\_Log\_Msg\_Callback(3)

An interface class used for getting logging callbacks.

## NAME

ACE\_Log\_Msg\_Callback -  An interface class used for getting logging callbacks.

## SYNOPSIS

```
#include <ace/Log_Msg.h>
class ACE_Log_Msg_Callback
{
  public:
    virtual ~ACE_Log_Msg_Callback (void);
    virtual void log (ACE_Log_Record &log_record) = 0;
};
```

## DESCRIPTION

Users who are interested in getting the logging messages directly, can subclass this interface and override the log() method. They must then register their subclass with the Log\_Msg class and make sure that they turn on the ACE\_Log\_Msg::MSG\_CALLBACK flag.

Your log routine is called with an instance of ACE\_Log\_Record.  From this class, you can get the log message, the verbose log message, message type, message priority, and so on.

Remember that there is one Log\_Msg object per thread. Therefore, you may need to register your callback object with many ACE\_Log\_Msg objects (and have the correct synchronization in the log method) or have a separate callback object per Log\_Msg object.

## PUBLIC MEMBERS

```
virtual ~ACE_Log_Msg_Callback (void);
```

No-op virtual destructor.

```
virtual void log (ACE_Log_Record &log_record) = 0;
```

Callback routine.  This is called when we want to log a message. Since this routine is pure virtual, it must be overwritten by the subclass.

## AUTHOR

Doug Schmidt

## LIBRARY

ace
