# Poco

# class LoggingRegistry

Library: Foundation
Package: Logging
Header: Poco/LoggingRegistry.h

## Description

A registry for channels and formatters.

The LoggingRegistry class is used for configuring the logging framework.

## Member Summary

Member Functions: channelForName, clear, defaultRegistry, formatterForName, hasChannel, hasFormatter, registerChannel, registerFormatter, unregisterChannel, unregisterFormatter

## Constructors

### LoggingRegistry

LoggingRegistry();

Creates the LoggingRegistry.

## Destructor

### ~LoggingRegistry

~LoggingRegistry();

Destroys the LoggingRegistry.

## Member Functions

### channelForName

Channel::Ptr channelForName(
const std::string & name
) const;

Returns the Channel object which has been registered under the given name.

Throws a NotFoundException if the name is unknown.

### clear

void clear();

Unregisters all registered channels and formatters.

### defaultRegistry

static LoggingRegistry & defaultRegistry();

Returns a reference to the default LoggingRegistry.

### formatterForName

Formatter::Ptr formatterForName(
const std::string & name
) const;

Returns the Formatter object which has been registered under the given name.

Throws a NotFoundException if the name is unknown.

### hasChannel

bool hasChannel(
const std::string & name
) const;

Returns true if a channel with the given name has been registered, false otherwise.

### hasFormatter

bool hasFormatter(
const std::string & name
) const;

Returns true if a formatter with the given name has been registered, false otherwise.

### registerChannel

void registerChannel(
const std::string & name,
Channel::Ptr pChannel
);

Registers a channel under a given name. It is okay to re-register a different channel under an already existing name.

### registerFormatter

void registerFormatter(
const std::string & name,
Formatter::Ptr pFormatter
);

Registers a formatter under a given name. It is okay to re-register a different formatter under an already existing name.

### unregisterChannel

void unregisterChannel(
const std::string & name
);

Unregisters the given channel.

Throws a NotFoundException if the name is unknown.

### unregisterFormatter

void unregisterFormatter(
const std::string & name
);

Unregisters the given formatter.

Throws a NotFoundException if the name is unknown.