~ubuntu-branches/ubuntu/trusty/uwsgi/trusty

« back to all changes in this revision

Viewing changes to plugins/syslog/syslog_plugin.c

  • Committer: Package Import Robot
  • Author(s): Janos Guljas
  • Date: 2012-02-13 03:43:28 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120213034328-d02hz8m5pon6kaxf
Tags: 1.0.3+dfsg-1
* New upstream version.
* Adjust rack plugin LD_RUN_PATH patch.
* Adjust patch for uWSGI Control Center jQuery links in templates.
* Remove '-fno-strict-aliasing' CFLAG patch as it is implemented upstream.
* Remove fix indentation of uwsgidecorators_py patch as implemented upstream.
* Adjust init scripts to use top-bottom options order, as --inherit option
  is not working as in earlier versions. 
* Update debian/copyright file.
* Add LSB Description field to debian/uwsgi.init.d.
* Set Architecture to "all" for binary package uwsgi-extra because
  it contains no architecture dependent files.
* Change uwsgi description. (Closes: #640698)
* New binary packages:
  - uwsgi-plugin-carbon
  - uwsgi-plugin-graylog2
  - uwsgi-plugin-logsocket
  - uwsgi-plugin-probeconnect
  - uwsgi-plugin-probepg
  - uwsgi-plugin-rrdtool
  - uwsgi-plugin-rsyslog
  - uwsgi-plugin-signal
  - uwsgi-plugin-symcall
  - uwsgi-plugin-syslog
* python-uwsgidecorators:
  - fix binary-install rule to call dh_python2
  - remove debian/source.lintian-overrides
* uwsgi-plugin-jvm-openjdk-6:
  - fix FTBFS on armel and powerpc (Closes: #656280)
* uwsgi-plugin-python:
  - document issue "ImportError: No module named site" when using
    virtualenv with Python 2.6 in README.Debian (Closes: #654333)
* Adjust debian/watch uversionmangle option.
* Repack upstram source to remove minimized jQuery and jQuery UI JavaScript
  libraries:
  - add get-orig-source rule to debian/rules
  - append +dfsg to upstream version
  - update debian/watch with dversionmangle option

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "../../uwsgi.h"
 
2
 
 
3
#include <syslog.h>
 
4
 
 
5
extern struct uwsgi_server uwsgi;
 
6
 
 
7
ssize_t uwsgi_syslog_logger(struct uwsgi_logger *ul, char *message, size_t len) {
 
8
 
 
9
        char *syslog_opts;
 
10
 
 
11
        if (!ul->configured) {
 
12
 
 
13
                setlinebuf(stderr);
 
14
 
 
15
                if (uwsgi.choosen_logger_arg == NULL) {
 
16
                        syslog_opts = "uwsgi";
 
17
                }
 
18
                else {
 
19
                        syslog_opts = uwsgi.choosen_logger_arg;
 
20
                }
 
21
 
 
22
                openlog(syslog_opts, 0, LOG_DAEMON);
 
23
 
 
24
                ul->configured = 1;
 
25
        }
 
26
 
 
27
        syslog(LOG_INFO, "%.*s", (int) len, message);
 
28
        return 0;
 
29
 
 
30
}
 
31
 
 
32
void uwsgi_syslog_register() {
 
33
        uwsgi_register_logger("syslog", uwsgi_syslog_logger);
 
34
}
 
35
 
 
36
int uwsgi_syslog_init() {
 
37
        return 0;
 
38
}
 
39
 
 
40
struct uwsgi_plugin syslog_plugin = {
 
41
 
 
42
        .name = "syslog",
 
43
        .on_load = uwsgi_syslog_register,
 
44
        .init = uwsgi_syslog_init
 
45
 
 
46
};
 
47