978db85fc7396189e3b5b2f49bd1927f3854abdd
[ipfire-2.x.git] / src / patches / ddns-003-Add-a-program-prefix-to-syslog-messages.patch
1 From 21fd4b8d26d01d622185ab8de971a9ee934220a3 Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Thu, 24 Jul 2014 13:23:36 +0200
4 Subject: [PATCH] Add a program prefix to syslog messages.
5
6 ---
7  src/ddns/__init__.py | 2 ++
8  1 file changed, 2 insertions(+)
9
10 diff --git a/src/ddns/__init__.py b/src/ddns/__init__.py
11 index 22764e6..6fe3a33 100644
12 --- a/src/ddns/__init__.py
13 +++ b/src/ddns/__init__.py
14 @@ -42,6 +42,8 @@ def setup_logging():
15         handler = logging.handlers.SysLogHandler(address="/dev/log",
16                 facility=logging.handlers.SysLogHandler.LOG_DAEMON
17         )
18 +       formatter = logging.Formatter("ddns[%(process)d]: %(message)s")
19 +       handler.setFormatter(formatter)
20         handler.setLevel(logging.INFO)
21         rootlogger.addHandler(handler)
22  
23 -- 
24 1.9.3
25