-
Notifications
You must be signed in to change notification settings - Fork 135
Config_Logging
Program-Y using Python logging for all logging output. For a full description of how to specify logging configuration options see the Python Logging Documentation
The current logging file is as follows and is a good start which logs all output to /tmp/y-bot.log
version: 1
disable_existing_loggers: False
formatters:
simple:
format: '%(asctime)s %(name)-10s %(levelname)-7s %(message)s'
handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: simple
filename: /tmp/y-bot.log
root:
level: DEBUG
handlers:
- file
If for some reason you want to switch off logging then you have 2 options, either
Log to /dev/null on Linux as follows
version: 1
disable_existing_loggers: False
formatters:
simple:
format: '%(asctime)s %(name)-10s %(levelname)-7s %(message)s'
handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: simple
filename: /dev/null
root:
level: DEBUG
handlers:
- file
This is useful if you just want to switch off logging temporarily but switch back the file later
Alternatively use the NullHandler as follows
version: 1
disable_existing_loggers: False
formatters:
simple:
format: '%(asctime)s %(name)-10s %(levelname)-7s %(message)s'
handlers:
file:
class: logging.handlers.NullHandler
formatter: simple
root:
level: DEBUG
handlers:
- file
This being a more permanent solution
An alternative to changing where the output is written to is to change the logging level. In Python logging there are X levels
- CRITICAL
- ERROR
- WARNING
- INFO
- DEBUG
Where DEBUG is the most verbose and produces the most output an CRITICAL will only output the most major issues, usually when something catastrophic ( or critical ! ) has gone wrong and the application is about to terminate
Email: [email protected] | Twitter: @keiffster | Facebook: keith.sterling | LinkedIn: keithsterling | My Blog
- Home
- Background
- Guiding Principles
- Reporting an Issue
- Installation
- You And Your Bot
- Bots
- Clients
- Configuration
- AIML
- Sentence Splitting
- Natural Langauge Processing
- Normalization
- Spelling
- Sentiment Analysis
- Translation
- Security
- Hot Reload
- Logging
- Out of Band
- Multi Language
- RDF Support
- Rich Media
- Asynchronous Events
- Triggers
- External Services
- Dynamic Sets, Maps & Vars
- Extensions
- Pre & Post Processors
- Custom Nodes
- The Brain Tree
- Utilities
- Building It Yourself
- Creating Your Own Bot
- Contributing
- Performance Testing
- FAQ
- History
- Website