sd-journal(3) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | THREAD SAFETY | NOTES | SEE ALSO | COLOPHON

SD-JOURNAL(3)                    sd-journal                    SD-JOURNAL(3)

NAME         top

       sd-journal - APIs for submitting and querying log entries to and from
       the journal

SYNOPSIS         top

       #include <systemd/sd-journal.h>

       pkg-config --cflags --libs libsystemd

DESCRIPTION         top

       sd-journal.h provides APIs to submit and query log entries. The APIs
       exposed act both as client for the systemd-journald.service(8)
       journal service and as parser for the journal files on disk.

       See sd_journal_print(3), sd_journal_stream_fd(3), sd_journal_open(3),
       sd_journal_next(3), sd_journal_get_realtime_usec(3),
       sd_journal_add_match(3), sd_journal_seek_head(3),
       sd_journal_enumerate_fields(3), sd_journal_get_cursor(3),
       sd_journal_get_cutoff_realtime_usec(3),
       sd_journal_get_cutoff_monotonic_usec(3), sd_journal_get_usage(3),
       sd_journal_get_catalog(3), sd_journal_get_fd(3),
       sd_journal_has_runtime_files(3) and
       sd_journal_has_persistent_files(3) for more information about the
       functions implemented.

       Command line access for submitting entries to the journal is
       available with the systemd-cat(1) tool. Command line access for
       querying entries from the journal is available with the journalctl(1)
       tool.

THREAD SAFETY         top

       Functions that operate on sd_journal objects are thread agnostic —
       given sd_journal pointer may only be used from one specific thread at
       all times (and it has to be the very same one during the entire
       lifetime of the object), but multiple, independent threads may use
       multiple, independent objects safely. Other functions — those that
       are used to send entries to the journal, like sd_journal_print(3) and
       similar, or those that are used to retrieve global information like
       sd_journal_stream_fd(3) and sd_journal_get_catalog_for_message_id(3)
       — are fully thread-safe and may be called from multiple threads in
       parallel.

NOTES         top

       These APIs are implemented as a shared library, which can be compiled
       and linked to with the libsystemd pkg-config(1) file.

SEE ALSO         top

       systemd(1), sd_journal_print(3), sd_journal_stream_fd(3),
       sd_journal_open(3), sd_journal_next(3), sd_journal_get_data(3),
       sd_journal_get_realtime_usec(3), sd_journal_add_match(3),
       sd_journal_seek_head(3), sd_journal_enumerate_fields(3),
       sd_journal_get_cursor(3), sd_journal_get_cutoff_realtime_usec(3),
       sd_journal_get_cutoff_monotonic_usec(3), sd_journal_get_usage(3),
       sd_journal_get_fd(3), sd_journal_query_unique(3),
       sd_journal_get_catalog(3), sd_journal_has_runtime_files(3),
       sd_journal_has_persistent_files(3), journalctl(1), sd-id128(3),
       pkg-config(1)

COLOPHON         top

       This page is part of the systemd (systemd system and service manager)
       project.  Information about the project can be found at 
       ⟨http://www.freedesktop.org/wiki/Software/systemd⟩.  If you have a bug
       report for this manual page, see
       ⟨http://www.freedesktop.org/wiki/Software/systemd/#bugreports⟩.  This
       page was obtained from the project's upstream Git repository
       ⟨https://github.com/systemd/systemd.git⟩ on 2020-08-13.  (At that
       time, the date of the most recent commit that was found in the repos‐
       itory was 2020-08-11.)  If you discover any rendering problems in
       this HTML version of the page, or you believe there is a better or
       more up-to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not part
       of the original manual page), send a mail to man-pages@man7.org

systemd 246                                                    SD-JOURNAL(3)

Pages that refer to this page: sd_journal(3)sd_journal_add_conjunction(3)sd_journal_add_disjunction(3)sd_journal_add_match(3)sd_journal_all_namespaces(3)SD_JOURNAL_ALL_NAMESPACES(3)sd_journal_append(3)SD_JOURNAL_APPEND(3)sd_journal_close(3)sd_journal_current_user(3)SD_JOURNAL_CURRENT_USER(3)sd_journal_enumerate_available_data(3)sd_journal_enumerate_available_unique(3)sd_journal_enumerate_data(3)sd_journal_enumerate_fields(3)sd_journal_enumerate_unique(3)sd_journal_flush_matches(3)sd_journal_foreach(3)SD_JOURNAL_FOREACH(3)sd_journal_foreach_backwards(3)SD_JOURNAL_FOREACH_BACKWARDS(3)sd_journal_foreach_data(3)SD_JOURNAL_FOREACH_DATA(3)sd_journal_foreach_field(3)SD_JOURNAL_FOREACH_FIELD(3)sd_journal_foreach_unique(3)SD_JOURNAL_FOREACH_UNIQUE(3)sd_journal_get_catalog(3)sd_journal_get_catalog_for_message_id(3)sd_journal_get_cursor(3)sd_journal_get_cutoff_monotonic_usec(3)sd_journal_get_cutoff_realtime_usec(3)sd_journal_get_data(3)sd_journal_get_data_threshold(3)sd_journal_get_events(3)sd_journal_get_fd(3)sd_journal_get_monotonic_usec(3)sd_journal_get_realtime_usec(3)sd_journal_get_timeout(3)sd_journal_get_usage(3)sd_journal_has_persistent_files(3)sd_journal_has_runtime_files(3)sd_journal_include_default_namespace(3)SD_JOURNAL_INCLUDE_DEFAULT_NAMESPACE(3)sd_journal_invalidate(3)SD_JOURNAL_INVALIDATE(3)sd_journal_local_only(3)SD_JOURNAL_LOCAL_ONLY(3)sd_journal_next(3)sd_journal_next_skip(3)sd_journal_nop(3)SD_JOURNAL_NOP(3)sd_journal_open(3)sd_journal_open_directory(3)sd_journal_open_directory_fd(3)sd_journal_open_files(3)sd_journal_open_files_fd(3)sd_journal_open_namespace(3)sd_journal_os_root(3)SD_JOURNAL_OS_ROOT(3)sd_journal_perror(3)sd_journal_perror_with_location(3)sd_journal_previous(3)sd_journal_previous_skip(3)sd_journal_print(3)sd_journal_printv(3)sd_journal_printv_with_location(3)sd_journal_print_with_location(3)sd_journal_process(3)sd_journal_query_unique(3)sd_journal_reliable_fd(3)sd_journal_restart_data(3)sd_journal_restart_fields(3)sd_journal_restart_unique(3)sd_journal_runtime_only(3)SD_JOURNAL_RUNTIME_ONLY(3)sd_journal_seek_cursor(3)sd_journal_seek_head(3)sd_journal_seek_monotonic_usec(3)sd_journal_seek_realtime_usec(3)sd_journal_seek_tail(3)sd_journal_send(3)sd_journal_sendv(3)sd_journal_sendv_with_location(3)sd_journal_send_with_location(3)sd_journal_set_data_threshold(3)sd_journal_stream_fd(3)sd_journal_suppress_location(3)SD_JOURNAL_SUPPRESS_LOCATION(3)sd_journal_system(3)SD_JOURNAL_SYSTEM(3)sd_journal_test_cursor(3)sd_journal_wait(3)30-systemd-environment-d-generator(7)systemd.directives(7)systemd.index(7)systemd.journal-fields(7)systemd-journald(8)systemd-journald-audit.socket(8)systemd-journald-dev-log.socket(8)systemd-journald.service(8)systemd-journald@.service(8)systemd-journald.socket(8)systemd-journald@.socket(8)systemd-journald-varlink.socket(8)systemd-journald-varlink@.socket(8)