source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/examples/logging.example.conf @ 42095c5

mainqndtest v1.1.1
Last change on this file since 42095c5 was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 3.8 KB
Line 
1#  Configure the Python logging facility.
2#  To use this file, copy it to logging.conf and edit logging.conf as required.
3#  See http://docs.python.org/library/logging.html for details of the logging facility.
4#  Note that this is not the newer logging.config facility.
5#
6#  The default configuration is console-based (stdout) for backward compatibility;
7#  edit the [handlers] section to choose a different logging destination.
8#
9#  Note that file-based handlers are thread-safe but not mp-safe;
10#  for mp-safe logging, configure the appropriate syslog handler.
11#
12#  To create a configurable logger for application 'myapp', add myapp to
13#  the [loggers] keys list and add a [logger_myapp] section, using
14#  [logger_welcome] as a starting point.
15#
16#  In your application, create your logger in your model or in a controller:
17#
18#  import logging
19#  logger = logging.getLogger("web2py.app.myapp")
20#  logger.setLevel(logging.DEBUG)
21#
22#  To log a message:
23#
24#  logger.debug("You ought to know that %s", details)
25#
26#  Note that a logging call will be governed by the most restrictive level
27#  set by the setLevel call, the [logger_myapp] section, and the [handler_...]
28#  section. For example, you will not see DEBUG messages unless all three are
29#  set to DEBUG.
30#
31#  Available levels: DEBUG INFO WARNING ERROR CRITICAL
32
33[loggers]
34keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome
35
36[handlers]
37keys=consoleHandler,messageBoxHandler,rotatingFileHandler
38#keys=consoleHandler,rotatingFileHandler
39#keys=osxSysLogHandler
40#keys=notifySendHandler
41
42[formatters]
43keys=simpleFormatter
44
45[logger_root]
46level=WARNING
47handlers=consoleHandler,rotatingFileHandler
48
49[logger_web2py]
50level=WARNING
51handlers=consoleHandler,rotatingFileHandler
52qualname=web2py
53propagate=0
54
55#  URL rewrite logging (routes.py)
56#  See also the logging parameter in routes.py
57#
58[logger_rewrite]
59level=WARNING
60qualname=web2py.rewrite
61handlers=consoleHandler,rotatingFileHandler
62propagate=0
63
64[logger_cron]
65level=WARNING
66qualname=web2py.cron
67handlers=consoleHandler,rotatingFileHandler
68propagate=0
69
70# generic app handler
71[logger_app]
72level=WARNING
73qualname=web2py.app
74handlers=consoleHandler,rotatingFileHandler
75propagate=0
76
77# welcome app handler
78[logger_welcome]
79level=WARNING
80qualname=web2py.app.welcome
81handlers=consoleHandler,rotatingFileHandler
82propagate=0
83
84# loggers for legacy getLogger calls: Rocket and markdown
85[logger_rocket]
86level=WARNING
87handlers=consoleHandler,messageBoxHandler,rotatingFileHandler
88qualname=Rocket
89propagate=0
90
91[logger_markdown]
92level=WARNING
93handlers=consoleHandler,rotatingFileHandler
94qualname=markdown
95propagate=0
96
97[handler_consoleHandler]
98class=StreamHandler
99level=WARNING
100formatter=simpleFormatter
101args=(sys.stdout,)
102
103[handler_messageBoxHandler]
104class=gluon.messageboxhandler.MessageBoxHandler
105level=ERROR
106formatter=simpleFormatter
107args=()
108
109[handler_notifySendHandler]
110class=gluon.messageboxhandler.NotifySendHandler
111level=ERROR
112formatter=simpleFormatter
113args=()
114
115# Rotating file handler
116#   mkdir logs in the web2py base directory if not already present
117#   args: (filename[, mode[, maxBytes[, backupCount[, encoding[, delay]]]]])
118#
119[handler_rotatingFileHandler]
120class=handlers.RotatingFileHandler
121level=DEBUG
122formatter=simpleFormatter
123args=("web2py.log", "a", 1000000, 5)
124
125[handler_osxSysLogHandler]
126class=handlers.SysLogHandler
127level=WARNING
128formatter=simpleFormatter
129args=("/var/run/syslog", handlers.SysLogHandler.LOG_DAEMON)
130
131[handler_linuxSysLogHandler]
132class=handlers.SysLogHandler
133level=WARNING
134formatter=simpleFormatter
135args=("/dev/log", handlers.SysLogHandler.LOG_DAEMON)
136
137[handler_remoteSysLogHandler]
138class=handlers.SysLogHandler
139level=WARNING
140formatter=simpleFormatter
141args=(('sysloghost.domain.com', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_DAEMON)
142
143[formatter_simpleFormatter]
144format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
145datefmt=
Note: See TracBrowser for help on using the repository browser.