1 |
On Sat, 2009-08-22 at 10:39 +0200, Jarry wrote: |
2 |
> Hi, |
3 |
> I have a log-server (syslog-ng) collecting logs from my servers. |
4 |
> Everything works for standard logs: clients forward them to server |
5 |
> where they are filtered (based on facility or application) and |
6 |
> splitted into a few files (for each client). |
7 |
> |
8 |
> The problem is with portage logs: I can not find any pattern |
9 |
> I could use to filter them out. For example, this is small part |
10 |
> of /var/log/emerge.log: |
11 |
> |
12 |
> 1250923552: *** emerge sync |
13 |
> 1250923552: === sync |
14 |
> 1250923552: >>> Starting rsync with rsync://140.211.166.165/gentoo-portage |
15 |
> 1250923665: === Sync completed with rsync://140.211.166.165/gentoo-portage |
16 |
> 1250923666: *** terminating. |
17 |
> 1250923760: Started emerge on: Aug 22, 2009 06:49:20 |
18 |
> 1250923760: *** emerge depclean |
19 |
> 1250923760: >>> depclean |
20 |
> ... |
21 |
> |
22 |
> Can I somehow force portage to write all its logs (summary.log, |
23 |
> emerge-fetch.log, emerge.log) in standard syslog format RFC-3164? |
24 |
> I mean with all that stuff like priority (facility), header |
25 |
> (timestamp, hostname), application, etc. Even better if portage |
26 |
> could write its logs to /dev/log... |
27 |
|
28 |
Portage doesn't use syslog format (that's why it doesn't log to |
29 |
syslog ;) |
30 |
|
31 |
There is the portrage elog system but's kinda a misnomer (maybe should |
32 |
be called portage message system). You can change |
33 |
PORTAGE_ELOG_SYSTEM="syslog" but it won't do what you are expecting. |
34 |
|
35 |
I'm not sure what you are trying to "filter out". Portage logs are |
36 |
relatively machine-readable (e.g. qlop). |
37 |
|
38 |
If you don't mind getting your hands dirty, portage is written mostly in |
39 |
python and bash so it shouldn't be that difficult to dig into the parts |
40 |
that handle emerge.log and emerge-fetch.log and convert them to syslog. |
41 |
|
42 |
-a |