logging.example.conf 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. [loggers]
  33. keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome
  34. [handlers]
  35. keys=consoleHandler,messageBoxHandler,rotatingFileHandler
  36. #keys=consoleHandler,rotatingFileHandler
  37. #keys=osxSysLogHandler
  38. #keys=notifySendHandler
  39. [formatters]
  40. keys=simpleFormatter
  41. [logger_root]
  42. level=WARNING
  43. handlers=consoleHandler,rotatingFileHandler
  44. [logger_web2py]
  45. level=WARNING
  46. handlers=consoleHandler,rotatingFileHandler
  47. qualname=web2py
  48. propagate=0
  49. # URL rewrite logging (routes.py)
  50. # See also the logging parameter in routes.py
  51. #
  52. [logger_rewrite]
  53. level=WARNING
  54. qualname=web2py.rewrite
  55. handlers=consoleHandler,rotatingFileHandler
  56. propagate=0
  57. [logger_cron]
  58. level=WARNING
  59. qualname=web2py.cron
  60. handlers=consoleHandler,rotatingFileHandler
  61. propagate=0
  62. # generic app handler
  63. [logger_app]
  64. level=WARNING
  65. qualname=web2py.app
  66. handlers=consoleHandler,rotatingFileHandler
  67. propagate=0
  68. # welcome app handler
  69. [logger_welcome]
  70. level=WARNING
  71. qualname=web2py.app.welcome
  72. handlers=consoleHandler,rotatingFileHandler
  73. propagate=0
  74. # loggers for legacy getLogger calls: Rocket and markdown
  75. [logger_rocket]
  76. level=WARNING
  77. handlers=consoleHandler,messageBoxHandler,rotatingFileHandler
  78. qualname=Rocket
  79. propagate=0
  80. [logger_markdown]
  81. level=WARNING
  82. handlers=consoleHandler,rotatingFileHandler
  83. qualname=markdown
  84. propagate=0
  85. [handler_consoleHandler]
  86. class=StreamHandler
  87. level=WARNING
  88. formatter=simpleFormatter
  89. args=(sys.stdout,)
  90. [handler_messageBoxHandler]
  91. class=gluon.messageboxhandler.MessageBoxHandler
  92. level=ERROR
  93. formatter=simpleFormatter
  94. args=()
  95. [handler_notifySendHandler]
  96. class=gluon.messageboxhandler.NotifySendHandler
  97. level=ERROR
  98. formatter=simpleFormatter
  99. args=()
  100. # Rotating file handler
  101. # mkdir logs in the web2py base directory if not already present
  102. # args: (filename[, mode[, maxBytes[, backupCount[, encoding[, delay]]]]])
  103. #
  104. [handler_rotatingFileHandler]
  105. class=handlers.RotatingFileHandler
  106. level=DEBUG
  107. formatter=simpleFormatter
  108. args=("logs/web2py.log", "a", 1000000, 5)
  109. [handler_osxSysLogHandler]
  110. class=handlers.SysLogHandler
  111. level=WARNING
  112. formatter=simpleFormatter
  113. args=("/var/run/syslog", handlers.SysLogHandler.LOG_DAEMON)
  114. [handler_linuxSysLogHandler]
  115. class=handlers.SysLogHandler
  116. level=WARNING
  117. formatter=simpleFormatter
  118. args=("/dev/log", handlers.SysLogHandler.LOG_DAEMON)
  119. [handler_remoteSysLogHandler]
  120. class=handlers.SysLogHandler
  121. level=WARNING
  122. formatter=simpleFormatter
  123. args=(('sysloghost.domain.com', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_DAEMON)
  124. [formatter_simpleFormatter]
  125. format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
  126. datefmt=