You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ The default level is WARNING, which means that only events of this level and above will be visible
235
+
+ To change a logging level we can call setup_logging() method and pass the logging level as an argument.
236
+
+ Optional: we can also pass log format and date format string as a method argument to modify default format
237
+
238
+
```python
239
+
import logging
240
+
from splunklib import setup_logging
241
+
242
+
# To see debug and above level logs
243
+
setup_logging(logging.DEBUG)
244
+
```
245
+
233
246
### Changelog
234
247
235
248
The [CHANGELOG](CHANGELOG.md) contains a description of changes for each version of the SDK. For the latest version, see the [CHANGELOG.md](https://github.com/splunk/splunk-sdk-python/blob/master/CHANGELOG.md) on GitHub.
## Optional:Set up logging using logging.conf file
114
+
+ Inside the **default** directory of our app, we have a [logging.conf](https://github.com/splunk/splunk-sdk-python/blob/master/examples/searchcommands_app/package/default/logging.conf) file.
115
+
+ In logging.conf file we can define loggers, handlers and formatters for our app. refer [this doc](https://docs.python.org/2/library/logging.config.html#configuration-file-format) for more details
116
+
+ Logs will be written in the files specified in the handlers defined for the respective loggers
117
+
+ For **'searchcommands_app'** app logs will be written in **searchcommands_app.log** and **splunklib.log** files defined in respective handlers, and are present at $SPLUNK_HOME/etc/apps/searchcommands_app/ dir
118
+
+ By default logs will be written in the app's root directory, but it can be overriden by specifying the absolute path for the logs file in the conf file
119
+
+ By default, logging level is set to WARNING
120
+
+ To see debug and above level logs, Set level to DEBUG in logging.conf file
121
+
113
122
## License
114
123
115
124
This software is licensed under the Apache License 2.0. Details can be found in
0 commit comments