# Logging /var/log/emerge.log through syslog-ng

## Seather

I need to log the /var/log/emerge.log file through syslog-ng so that we can send it over to a central logging server.

For the moment I am just trying to get the emerge.log going "through" syslog-ng but I am guessing I don't exactly understand syslog-ng's configuration and missed something somewhere. This is what I have added to my syslog-ng.conf in the hopes of syslog-ng to pick it up and log it back into another file:

```

source emergesrc {

        file("/var/log/emerge.log");

};

destination emerge {

        file("/var/syslog/emerge.log");

};

log {

        source(emergesrc);

        destination(emerge);

};

```

However nothing comes in at /var/syslog/emerge.log (yes the directory '/var/syslog' is created).

Anyone knows what I might be missing?

----------

## think4urs11

It'll not work that way.

a) quick and dirty:

```
logger -t EMERGELOG -f /var/log/emerge.log
```

b) alternatively to cut off the epoch time information recorded in emerge.log

```
while read line; do echo $line | cut -d: -f2- | logger -t EMERGELOG; done </var/log/emerge.log
```

c)

- create a pipe

- copy the contents of emerge.log plus other needed parameters in the correct format to that pipe

- have syslog-ng listening to that pipe

- have syslog-ng writing everything from this pipe towards /var/log/messages or a seperate file

I do c) in the office as i needed to have a possibility to import log files from (among other strange systems) IBM AS/400 which is not capable to do syslog at all to my central logserver. So i've hacked around this by transfering the logs via FTP to the log server and import them via pipe into syslog-ng. If you like i can post the neccessary steps to set this pipe etc. up correct tomorrow.

----------

## mimosinnet

 *Think4UrS11 wrote:*   

> 
> 
> c)
> 
> - create a pipe
> ...

 

I would very much appreciate if you could post the necessary steps to set (c) as I am looking for a similar solution. Thanks!

----------

