|
| 1 | +# |
| 2 | +# The format and semantics of this file are described in this article at Python.org: |
| 3 | +# |
| 4 | +# [Configuration file format](https://docs.python.org/2/library/logging.config.html#configuration-file-format) |
| 5 | +# |
| 6 | +[loggers] |
| 7 | +keys = root, splunklib, SearchCommand |
| 8 | + |
| 9 | +[logger_root] |
| 10 | +# Default: WARNING |
| 11 | +level = DEBUG |
| 12 | +# Default: stderr |
| 13 | +handlers = stderr |
| 14 | + |
| 15 | +[logger_splunklib] |
| 16 | +qualname = splunklib |
| 17 | +# Default: WARNING |
| 18 | +level = NOTSET |
| 19 | +# Default: stderr |
| 20 | +handlers = splunklib |
| 21 | +# Default: 1 |
| 22 | +propagate = 0 |
| 23 | + |
| 24 | +[logger_SearchCommand] |
| 25 | +qualname = SearchCommand |
| 26 | +# Default: WARNING |
| 27 | +level = NOTSET |
| 28 | +# Default: stderr |
| 29 | +handlers = app |
| 30 | +# Default: 1 |
| 31 | +propagate = 0 |
| 32 | + |
| 33 | +[handlers] |
| 34 | +# See [logging.handlers](https://docs.python.org/2/library/logging.handlers.html) |
| 35 | +keys = app, splunklib, stderr |
| 36 | + |
| 37 | +[handler_app] |
| 38 | +# Select this handler to log events to app.log |
| 39 | +class = logging.handlers.RotatingFileHandler |
| 40 | +level = NOTSET |
| 41 | +args = ('app.log', 'a', 524288000, 9, 'utf-8', True) |
| 42 | +formatter = searchcommands |
| 43 | + |
| 44 | +[handler_splunklib] |
| 45 | +# Select this handler to log events to splunklib.log |
| 46 | +class = logging.handlers.RotatingFileHandler |
| 47 | +args = ('splunklib.log', 'a', 524288000, 9, 'utf-8', True) |
| 48 | +level = NOTSET |
| 49 | +formatter = searchcommands |
| 50 | + |
| 51 | +[handler_stderr] |
| 52 | +# Select this handler to log events to stderr which splunkd redirects to the associated job's search.log file |
| 53 | +class = logging.StreamHandler |
| 54 | +level = NOTSET |
| 55 | +args = (sys.stderr,) |
| 56 | +formatter = searchcommands |
| 57 | + |
| 58 | +[formatters] |
| 59 | +keys = searchcommands |
| 60 | + |
| 61 | +[formatter_searchcommands] |
| 62 | +format = %(asctime)s, Level=%(levelname)s, Pid=%(process)s, File=%(filename)s, Line=%(lineno)s, %(message)s |
0 commit comments