You are here

README.txt in File Log 6.2

Same filename and directory in other branches
  1. 6 README.txt
  2. 7 README.txt
===============================================================================
File logging
===============================================================================
A watchdog backend that logs system events directly into files.
This is an alternative to the Syslog core module, with the key difference that
this is useable on shared hosts, too.

Sections:
1.) Configuration
2.) Install, unistall, upgrade or configuration change
3.) Performance tips
4.) Maintainer


===============================================================================
Configuration
===============================================================================
The project is configurable through the $conf array under the key 'filelog' in
the site's settings.php (DRUPAL/sites/<site directory>/settings.php).

All directive is optional.

Example configuration:

$conf['filelog'] = array(
  'dir' => '/var/log/drupal/example.com',
  'log_level' => WATCHDOG_INFO,
  'type_levels' => array(),
  'buffer' => TRUE,
  'site_in_name' => TRUE,
  'type_in_name' => TRUE,
  'severity_in_name' => TRUE,
  'grouped_severity_in_name' => TRUE, //DEPRECATED
  'group_severity_in_name' => TRUE,
  'daily_files' => TRUE,
  'delete_files' => 7,
  'field_separator' => ' | ',
  'field_prefix' => '[',
  'field_suffix' => ']',
  'wrap_message' => TRUE,
  'log_base_url' => TRUE,
  'log_username' => TRUE,
  'date_format' => 'medium',
  'decode_severity' => TRUE,
  'skip_strip_tags' => TRUE,
  'chmod' => FALSE,
  'with_ui' => FALSE,
);

dir
  Log directory. Defaults to sites/<site directory>/logs.
  CAN'T CONTAIN TRAILING SLASH!

log_level
  Maximum severity (inclusive) to log from WATCHDOG_EMERG(0) to
  WATCHDOG_DEBUG(7). Defaults to WATCHDOG_DEBUG. This is the ganaric log level
  for message types that don't have their own level configured in type_levels.
  "type" is the first argument of watchdog().

type_levels
  Same as log_level but on a message type basis. If a type has its own log
  level, then that overrides the generic log_level.

buffer
  Controls whether the entries should be written to files immediately,
  or must be stored in a static buffer and be flushed in shutdown phase.

site_in_name
  Add the name of the configuration directory (when TRUE) or the configured
  string to the file name.

type_in_name
  Add the type argument of watchdog() to the file name.

severity_in_name
  Add the decoded severity to the file name.

grouped_severity_in_name //DEPRECATED
group_severity_in_name
  Add one of the following parts to the file name:
    debug: WATCHDOG_DEBUG;
    info: WATCHDOG_INFO, WATCHDOG_NOTICE, WATCHDOG_WARNING;
    error: all other levels.
  Used only when severity_in_name is enabled as a subdirective of it.

daily_files
  Add the current day's timestamp to the file name in the form YYYYMMDD.

delete_files
  Delete log files after the configured DAYS during cron run. Used only when
  daily_files is enabled.

field_separator
  Text to use to separe fields in records.

field_prefix
  Text to use to prefix fields in records.

field_suffix
  Text to use to suffix fields in records.

wrap_message
  Add the prefix and suffix to the message field, too.

log_base_url
  Add the base url to the record. This is the only one formatting directive,
  when 'with_ui' is enabled.

log_username
  Add the username to the record instead of the UID.

date_format
  Controls how to format the timestamp in the record.
  Possible values are 'small', 'medium', 'large' or a custom format acceptable
  by format_date() or FALSE to log the plain UNIX timestamp.

decode_severity
  Add severity to the record as text not as number.
  In general, severity is added to the record only, if it isn't part of
  or groupped in the file name.

skip_strip_tags
  Message and link fields are running through strip_tags() by default.

chmod
  It can contain the permission pattern for the newly created files,
  if there are file access problems out of the webserver (PHP) scope.
  It does't affect existing files!

with_ui
  This directive controls whether the entries are logged in a human readable
  format (themed) or in an encoded format ready to use by the UI module thus
  THIS DIRECTIVE MUST BE SET TO TRUE, TO LET THE UI MODULE WORK!


===============================================================================
Install, unistall, upgrade or configuration change
===============================================================================
Install
The module can be installed the same way as other drupal modules, with the
exception that configuration in settings.php must be done before install!

Uninstall
Backup of log files should be done before uninstall!

Upgrade or configuration change
To avoid inconsistent file names or file content, configuration changes should
happen as follows:
1. Disable the module
2. Backup and DELETE! log files (or change the log directory)
3. Change configuration
4. Enable the module


===============================================================================
Performance tips
===============================================================================
For the best performance:
- use custom log directory for each site or use the 'site_in_name' directive
- use a directive that results in multiple log files (like 'severity_in_name')
- disable the buffer only, if there are 'memory_limit' problems and there's no
  way to increase the limit 
- set the 'with_ui' directive to TRUE, but do not use the UI module on
  production sites
- use logratate.d, not the built-in feature whenever possible


===============================================================================
Maintainer
===============================================================================
István Németh <i.nemeth@xmarket.hu>
              http://drupal.org/user/231445

File

README.txt
View source
  1. ===============================================================================
  2. File logging
  3. ===============================================================================
  4. A watchdog backend that logs system events directly into files.
  5. This is an alternative to the Syslog core module, with the key difference that
  6. this is useable on shared hosts, too.
  7. Sections:
  8. 1.) Configuration
  9. 2.) Install, unistall, upgrade or configuration change
  10. 3.) Performance tips
  11. 4.) Maintainer
  12. ===============================================================================
  13. Configuration
  14. ===============================================================================
  15. The project is configurable through the $conf array under the key 'filelog' in
  16. the site's settings.php (DRUPAL/sites//settings.php).
  17. All directive is optional.
  18. Example configuration:
  19. $conf['filelog'] = array(
  20. 'dir' => '/var/log/drupal/example.com',
  21. 'log_level' => WATCHDOG_INFO,
  22. 'type_levels' => array(),
  23. 'buffer' => TRUE,
  24. 'site_in_name' => TRUE,
  25. 'type_in_name' => TRUE,
  26. 'severity_in_name' => TRUE,
  27. 'grouped_severity_in_name' => TRUE, //DEPRECATED
  28. 'group_severity_in_name' => TRUE,
  29. 'daily_files' => TRUE,
  30. 'delete_files' => 7,
  31. 'field_separator' => ' | ',
  32. 'field_prefix' => '[',
  33. 'field_suffix' => ']',
  34. 'wrap_message' => TRUE,
  35. 'log_base_url' => TRUE,
  36. 'log_username' => TRUE,
  37. 'date_format' => 'medium',
  38. 'decode_severity' => TRUE,
  39. 'skip_strip_tags' => TRUE,
  40. 'chmod' => FALSE,
  41. 'with_ui' => FALSE,
  42. );
  43. dir
  44. Log directory. Defaults to sites//logs.
  45. CAN'T CONTAIN TRAILING SLASH!
  46. log_level
  47. Maximum severity (inclusive) to log from WATCHDOG_EMERG(0) to
  48. WATCHDOG_DEBUG(7). Defaults to WATCHDOG_DEBUG. This is the ganaric log level
  49. for message types that don't have their own level configured in type_levels.
  50. "type" is the first argument of watchdog().
  51. type_levels
  52. Same as log_level but on a message type basis. If a type has its own log
  53. level, then that overrides the generic log_level.
  54. buffer
  55. Controls whether the entries should be written to files immediately,
  56. or must be stored in a static buffer and be flushed in shutdown phase.
  57. site_in_name
  58. Add the name of the configuration directory (when TRUE) or the configured
  59. string to the file name.
  60. type_in_name
  61. Add the type argument of watchdog() to the file name.
  62. severity_in_name
  63. Add the decoded severity to the file name.
  64. grouped_severity_in_name //DEPRECATED
  65. group_severity_in_name
  66. Add one of the following parts to the file name:
  67. debug: WATCHDOG_DEBUG;
  68. info: WATCHDOG_INFO, WATCHDOG_NOTICE, WATCHDOG_WARNING;
  69. error: all other levels.
  70. Used only when severity_in_name is enabled as a subdirective of it.
  71. daily_files
  72. Add the current day's timestamp to the file name in the form YYYYMMDD.
  73. delete_files
  74. Delete log files after the configured DAYS during cron run. Used only when
  75. daily_files is enabled.
  76. field_separator
  77. Text to use to separe fields in records.
  78. field_prefix
  79. Text to use to prefix fields in records.
  80. field_suffix
  81. Text to use to suffix fields in records.
  82. wrap_message
  83. Add the prefix and suffix to the message field, too.
  84. log_base_url
  85. Add the base url to the record. This is the only one formatting directive,
  86. when 'with_ui' is enabled.
  87. log_username
  88. Add the username to the record instead of the UID.
  89. date_format
  90. Controls how to format the timestamp in the record.
  91. Possible values are 'small', 'medium', 'large' or a custom format acceptable
  92. by format_date() or FALSE to log the plain UNIX timestamp.
  93. decode_severity
  94. Add severity to the record as text not as number.
  95. In general, severity is added to the record only, if it isn't part of
  96. or groupped in the file name.
  97. skip_strip_tags
  98. Message and link fields are running through strip_tags() by default.
  99. chmod
  100. It can contain the permission pattern for the newly created files,
  101. if there are file access problems out of the webserver (PHP) scope.
  102. It does't affect existing files!
  103. with_ui
  104. This directive controls whether the entries are logged in a human readable
  105. format (themed) or in an encoded format ready to use by the UI module thus
  106. THIS DIRECTIVE MUST BE SET TO TRUE, TO LET THE UI MODULE WORK!
  107. ===============================================================================
  108. Install, unistall, upgrade or configuration change
  109. ===============================================================================
  110. Install
  111. The module can be installed the same way as other drupal modules, with the
  112. exception that configuration in settings.php must be done before install!
  113. Uninstall
  114. Backup of log files should be done before uninstall!
  115. Upgrade or configuration change
  116. To avoid inconsistent file names or file content, configuration changes should
  117. happen as follows:
  118. 1. Disable the module
  119. 2. Backup and DELETE! log files (or change the log directory)
  120. 3. Change configuration
  121. 4. Enable the module
  122. ===============================================================================
  123. Performance tips
  124. ===============================================================================
  125. For the best performance:
  126. - use custom log directory for each site or use the 'site_in_name' directive
  127. - use a directive that results in multiple log files (like 'severity_in_name')
  128. - disable the buffer only, if there are 'memory_limit' problems and there's no
  129. way to increase the limit
  130. - set the 'with_ui' directive to TRUE, but do not use the UI module on
  131. production sites
  132. - use logratate.d, not the built-in feature whenever possible
  133. ===============================================================================
  134. Maintainer
  135. ===============================================================================
  136. István Németh
  137. http://drupal.org/user/231445