chiark / gitweb /
journal: allow setting of a cutoff log level for disk storage, syslog, kmsg, console...
[elogind.git] / src / journal / journald.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foojournaldhfoo
4 #define foojournaldhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2011 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <inttypes.h>
26 #include <sys/types.h>
27 #include <stdbool.h>
28
29 #include "journal-file.h"
30 #include "hashmap.h"
31 #include "util.h"
32 #include "audit.h"
33 #include "journal-rate-limit.h"
34 #include "list.h"
35
36 typedef struct StdoutStream StdoutStream;
37
38 typedef struct Server {
39         int epoll_fd;
40         int signal_fd;
41         int syslog_fd;
42         int native_fd;
43         int stdout_fd;
44         int proc_kmsg_fd;
45
46         JournalFile *runtime_journal;
47         JournalFile *system_journal;
48         Hashmap *user_journals;
49
50         uint64_t seqnum;
51
52         char *buffer;
53         size_t buffer_size;
54
55         JournalRateLimit *rate_limit;
56         usec_t rate_limit_interval;
57         unsigned rate_limit_burst;
58
59         JournalMetrics runtime_metrics;
60         JournalMetrics system_metrics;
61
62         bool compress;
63
64         bool forward_to_kmsg;
65         bool forward_to_syslog;
66         bool forward_to_console;
67
68         bool import_proc_kmsg;
69         char proc_kmsg_buffer[LINE_MAX+1];
70         size_t proc_kmsg_length;
71
72         uint64_t cached_available_space;
73         usec_t cached_available_space_timestamp;
74
75         uint64_t var_available_timestamp;
76
77         gid_t file_gid;
78         bool file_gid_valid;
79
80         LIST_HEAD(StdoutStream, stdout_streams);
81         unsigned n_stdout_streams;
82
83         char *tty_path;
84
85         int max_level_store;
86         int max_level_syslog;
87         int max_level_kmsg;
88         int max_level_console;
89 } Server;
90
91 /* gperf lookup function */
92 const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
93
94 #endif