Registering Your DLF Converter with the Lire Framework
Prev | Chapter 2. Writing a New DLF Converter | Next

## Registering Your DLF Converter with the Lire Framework

We first said that DLF converters are perl objects which implements the Lire::DlfConverter interface. What we did is write a class which implements the said interface. Creating the object from that class is the responsability of the DLF converter registration script. This is simply a snippet of perl code which instantiates your object and registers it with the Lire::PluginManager:

    use Lire::PluginManager;
    use MyConverters::SyslogCommonConverter;

    Lire::PluginManager->register_plugin(
                MyConverters::SyslogCommonConverter->new() );

That's all there is to it, really. You put this snippet in a file named `syslog_common_init` in one of the directories listed in the `plugins_init_path` configuration variable.

### Note

Some other notes on this topic:

1. The file can actually be named anything you want, the name ``service`_init` just make it clear what is the purpose of the file.

2. The initial value of the `plugins_init_path` contains the directories ``sysconfdir`/lire/plugins` and ``HOME`/.lire/plugins`. You can change this list by using the lire tool.

3. Your registration script can create and register more than one object.

You can now generate a www report for log files in that format using the command `lr_log2report common_syslog < file.log`.

Prev | Up | Next
The Meta-Data Methods | Home | DLF Converter API