Commit ab3728e
committed
Change: Adjust default logging configuration
Allow logging to stdout and file at the same time. With this commit the
default logging configuration is:
```
[handlers]
keys=console,file,syslog
[formatters]
keys=file,syslog
[formatter_file]
format=OSPD[$PID] %(asctime)s: %(levelname)s: (%(name)s) %(message)s
[formatter_syslog]
format=OSPD[$PID] %(levelname)s: (%(name)s) %(message)s
[handler_console]
class=logging.StreamHandler
level=INFO
formatter=file
args=sys.stdout
[handler_syslog]
class=handlers.SysLogHandler
level=INFO
formatter=syslog
args=("/dev/log", handlers.SysLogHandler.LOG_USER)
[handler_file]
class=handlers.WatchedFileHandler
level=INFO
formatter=file
args=("/dev/null", "a")
[loggers]
keys=root
[logger_root]
level=NOTSET
handlers=file
propagate=0
```
Depending on the `--foreground` and `--log-file` arguments only the
logger_root handlers value is adjusted. Additionally If `--log-file` is
set the handler_file args is updated to point to the value of the
argument.
(cherry picked from commit 52ef7a0)1 parent 65bd946 commit ab3728e
1 file changed
+31
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | | - | |
| 34 | + | |
37 | 35 | | |
38 | 36 | | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
| 51 | + | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 55 | + | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
65 | | - | |
| 61 | + | |
66 | 62 | | |
67 | 63 | | |
68 | 64 | | |
| |||
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
76 | | - | |
| 72 | + | |
77 | 73 | | |
78 | 74 | | |
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
90 | 101 | | |
91 | | - | |
92 | 102 | | |
| 103 | + | |
93 | 104 | | |
94 | 105 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| |||
0 commit comments