CanalTP/navitia — pull request #766 by antoine-de (2014-12-01 09:51:08+00:00)
Title: Tyr: change instance logger handling

instance logger is now copied from the 'instance' logger.

This way we can configure a custom formater for the instance (usefull
for the syslog for example).

logger conf example:
```python
LOGGER = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'default': {
'format': '[%(asctime)s] [%(levelname)5s] [%(process)5s]
[%(name)25s] %(message)s',
},
'instance': {
'format': '%(name)s: [%(asctime)s] [%(levelname)5s]
[%(process)5s] %(message)s',
}
},
'handlers': {
'default': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/home/antoine/run/tyr/tyr.log',
'formatter': 'default',
},
'instance': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/home/bob/run/tyr/%(name).log', --> for
FileHandler we can use the %(name) tag to output in a different file
'formatter': 'instance',
},
},
'loggers': {
'': {
'handlers': ['default'],
'level': 'DEBUG',
},
'instance': {
'handlers': ['instance'],
'level': 'DEBUG',
}
}
```