# &adminguide;

## Overview

This module provides logging to custom systems, replacing the default core logging to syslog. At this moment it can send the logs to an IP and port via UDP, once all modules have been initialized.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- none.

### External Libraries or Applications

The following libraries or applications must be installed before running &kamailio; with this module loaded:

- none

## Core Logging

This module can replace the syslog logging with sending the log messages to a remote address and port via UDP. The logging to remote target is started when all the modules are initialized, before that the default syslog system is used.

It requires that core parameters log_engine_type to be set to 'udp' and log_engine_data to be set to target 'address:port'. It is not enabled if log_stderror=yes.

### `log_udp` usage

    ...
    log_engine_type="udp"
    log_engine_data="127.0.0.1:9"
    ...
    loadmodule "log_custom.so"
    ...

## Functions

### `log_udp(text)`

Send the text to the address specified in core parameter log_engine_data. It is provided as sample function mainly for testing, because all logs messages printed by kamailio should be diverted as described in the section 'Core Logging', so you can use xlog functions in config file.

The parameter can contain variables.

This function can be used from ANY_ROUTE.

#### `log_udp` usage

    ...
       log_udp("R-URI is $ru\n");
    ...