Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A scalable pure-logging approach (as in using only system logging components) can be implemented using <a href="http://www.balabit.com/network-security/syslog-ng" rel="nofollow">syslog-ng</a></p> <p>syslog-ng is syslog++, so it will not break any syslog configurations and logging if you already have some. Installation on Ubuntu is straightforward:</p> <pre><code>sudo apt-get install syslog-ng </code></pre> <p>for installation on windows, refer:<a href="http://www.syslog.org/logged/running-syslog-ng-on-windows/" rel="nofollow">http://www.syslog.org/logged/running-syslog-ng-on-windows/</a></p> <p>Multiple django applications or multiple servers log to syslog-ng which uses UDP or TCP (depending on your configuration) to send it to a central syslog-ng server which logs it on that machine. You can use a basic regex to identify the application in syslog-ng and route it accordingly.</p> <p><strong>Django logging configuration</strong></p> <pre><code>'syslog-verbose': { 'format': 'myapp %(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' } 'ConcurrentLogHandler':{ 'level': 'DEBUG', 'class': 'logging.handlers.SysLogHandler', 'formatter': 'syslog-verbose', }, </code></pre> <p>Note the "myapp" string added to the formatter to identify the application by syslog-ng.</p> <p>You can even configure nginx, apache and other servers to log to syslog-ng. E.g. for apache:</p> <pre><code>CustomLog "| /usr/bin/logger -t 'apache' -u /var/run/apache_access_log.socket" combined </code></pre> <p><strong>Syslog-ng client configuration</strong></p> <p>Append this to the end of /etc/syslog-ng/syslog-ng.conf</p> <pre><code>filter filter_loghostclient { program("^myapp$"); }; destination dest_loghostclient { tcp("destination_logserver.example.com" port (514)); }; log { source(s_all); filter(filter_loghostclient); destination(dest_loghostclient); }; source s_apache_access { #apache access logs getting written directly to a socket (as described above) unix-stream("/var/run/apache_access_log.socket" max-connections(512) keep-alive(yes)); }; log{ source(s_apache_access); destination(dest_loghostclient); }; filter f_apache_err { #Apache error logs program("apache") and level(err); }; log{ source(s_all); filter(f_apache_err); destination(dest_loghostclient); }; </code></pre> <p><strong>Syslog-ng aggregator configuration</strong></p> <p>Append the following to the syslog-ng config file on destination_logserver.example.com</p> <pre><code>source src_loghostserver { tcp(port(514) keep-alive(yes) max_connections(1000)); }; destination dest_loghostserver { file("/var/log/myproject/request_\$R_YEAR\$R_MONTH\$R_DAY.log"); }; log { source(src_loghostserver); destination(dest_loghostserver); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload