Debian Codegraph @

upstream/debian-unstable/man3/sd-journal.3

raw
1 '\" t
2 .TH "SD\-JOURNAL" "3" "" "systemd 261~rc3" "sd-journal"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 sd-journal \- APIs for submitting and querying log entries to and from the journal
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-journal\&.h>
29 .fi
30 .ft
31 .HP \w'\fBpkg\-config\ \-\-cflags\ \-\-libs\ libsystemd\fR\ 'u
32 \fBpkg\-config \-\-cflags \-\-libs libsystemd\fR
33 .SH "DESCRIPTION"
34 .PP
35 sd\-journal\&.h
36 is part of
37 \fBlibsystemd\fR(3)
38 and provides APIs to submit and query log entries\&. The APIs exposed act both as client for the
39 \fBsystemd-journald.service\fR(8)
40 journal service and as parser for the journal files on disk\&.
41 .PP
42 See
43 \fBsd_journal_print\fR(3),
44 \fBsd_journal_stream_fd\fR(3),
45 \fBsd_journal_open\fR(3),
46 \fBsd_journal_next\fR(3),
47 \fBsd_journal_get_realtime_usec\fR(3),
48 \fBsd_journal_add_match\fR(3),
49 \fBsd_journal_seek_head\fR(3),
50 \fBsd_journal_enumerate_fields\fR(3),
51 \fBsd_journal_get_cursor\fR(3),
52 \fBsd_journal_get_cutoff_realtime_usec\fR(3),
53 \fBsd_journal_get_cutoff_monotonic_usec\fR(3),
54 \fBsd_journal_get_usage\fR(3),
55 \fBsd_journal_get_catalog\fR(3),
56 \fBsd_journal_get_fd\fR(3),
57 \fBsd_journal_has_runtime_files\fR(3)
58 and
59 \fBsd_journal_has_persistent_files\fR(3)
60 for more information about the functions implemented\&.
61 .PP
62 Command line access for submitting entries to the journal is available with the
63 \fBsystemd-cat\fR(1)
64 tool\&. Command line access for querying entries from the journal is available with the
65 \fBjournalctl\fR(1)
66 tool\&.
67 .SH "THREAD SAFETY"
68 .PP
69 Functions that operate on
70 sd_journal
71 objects are thread agnostic \(em a given
72 sd_journal
73 pointer may only be used from one thread at a time, but multiple independent threads may use multiple objects concurrently\&. Some functions \(em those that are used to send entries to the journal, like
74 \fBsd_journal_print\fR(3)
75 and similar, or those that are used to retrieve global information like
76 \fBsd_journal_stream_fd\fR(3)
77 and
78 \fBsd_journal_get_catalog_for_message_id\fR(3)
79 \(em are fully thread\-safe and may be called from multiple threads in parallel\&.
80 .SH "OPTIONAL DEPENDENCIES"
81 .PP
82 Depending on which build\-time options are enabled, functions that operate on
83 sd_journal
84 objects might cause optional shared libraries to be dynamically loaded via
85 \fBdlopen\fR(3), such as decompression libraries (xz, lz4, zstd) or cryptographic libraries (gcrypt)\&.
86 .SH "NOTES"
87 .PP
88 Functions described here are available as a shared library, which can be compiled against and linked to with the
89 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
90 file\&.
91 .PP
92 The code described here uses
93 \fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call
94 \fBsetenv\fR(3)
95 from a parallel thread\&. It is recommended to only do calls to
96 \fBsetenv()\fR
97 from an early phase of the program when no other threads have been started\&.
98 .SH "SEE ALSO"
99 .PP
100 \fBsystemd\fR(1), \fBsd_journal_print\fR(3), \fBsd_journal_stream_fd\fR(3), \fBsd_journal_open\fR(3), \fBsd_journal_next\fR(3), \fBsd_journal_get_data\fR(3), \fBsd_journal_get_realtime_usec\fR(3), \fBsd_journal_add_match\fR(3), \fBsd_journal_seek_head\fR(3), \fBsd_journal_enumerate_fields\fR(3), \fBsd_journal_get_cursor\fR(3), \fBsd_journal_get_cutoff_realtime_usec\fR(3), \fBsd_journal_get_cutoff_monotonic_usec\fR(3), \fBsd_journal_get_usage\fR(3), \fBsd_journal_get_fd\fR(3), \fBsd_journal_query_unique\fR(3), \fBsd_journal_get_catalog\fR(3), \fBsd_journal_has_runtime_files\fR(3), \fBsd_journal_has_persistent_files\fR(3), \fBjournalctl\fR(1), \fBsd-id128\fR(3), \fBpkg-config\fR(1)