summaryrefslogtreecommitdiff
path: root/src/shared/logs-show.c
AgeCommit message (Collapse)Author
2013-06-26journalctl: highlight MESSAGE= in verbose outputZbigniew Jędrzejewski-Szmek
When looking at verbose output, additional "work" is required to pick out the interesting MESSAGE= lines from all the fields. Also, show long fields in full in verbose output mode when OUTPUT_FULL_WIDTH is specified.
2013-06-20journalctl,systemctl: show messages tagged with OBJECT_SYSTEMD_[USER_]_UNITZbigniew Jędrzejewski-Szmek
Replace mallocs with alloca while at it.
2013-06-20Make sure we only show authentic coredump messagesZbigniew Jędrzejewski-Szmek
Before we only checked the MESSAGE_ID and COREDUMP_UNIT. Those are both user-controlled fields. For COREDUMP_USER_UNIT, relax the rules a bit, and also allow messages from _UID=0.
2013-06-20Add hasprefix macro to check prefixes of fixed lengthZbigniew Jędrzejewski-Szmek
2013-06-20journalctl: show lines in full with --allZbigniew Jędrzejewski-Szmek
In 31f7bf1 "logs-show: print multiline messages", I forgot to take into account the fact that --all implies --full for journalctl.
2013-06-10journal: add ability to filter by current userZbigniew Jędrzejewski-Szmek
This is the just the library part. SD_JOURNAL_CURRENT_USER flags is added to sd_j_open(), to open files from current user. SD_JOURNAL_SYSTEM_ONLY is renamed to SD_JOURNAL_SYSTEM, and changed to mean to (also) open system files. This way various flags can be combined, which gives them nicer semantics, especially if other ones are added later. Backwards compatibility is kept, because SD_JOURNAL_SYSTEM_ONLY is equivalent to SD_JOURNAL_SYSTEM if used alone, and before there we no other flags.
2013-06-09journalctl: fix verbose output when no logs are foundZbigniew Jędrzejewski-Szmek
$ journalctl -o verbose _EXE=/quiet/binary -f -- Logs begin at Sun 2013-03-17 17:28:22 EDT. -- Failed to get realtime timestamp: Cannot assign requested address JOURNAL_FOREACH_DATA_RETVAL is added, which allows the caller to get the return value from sd_journal_enumerate_data. I think we might want to expose this macro like SD_JOURNAL_FOREACH_DATA, but for now it is in journal-internal.h. There's a change in behaviour for output_*, not only in output_verbose, that errors in sd_j_enumerate_data are not silently ignored anymore. https://bugs.freedesktop.org/show_bug.cgi?id=56459
2013-06-09logs-show: print multiline messagesZbigniew Jędrzejewski-Szmek
[ 0.019862] fedora kernel: CPU0: Thermal monitoring enabled (TM1) [ 0.019900] fedora kernel: Last level iTLB entries: 4KB 512, 2MB 0, 4MB 0 Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32 tlb_flushall_shift: 5 [ 0.020118] fedora kernel: Freeing SMP alternatives: 24k freed
2013-06-04systemctl: limit logs in status to current bootZbigniew Jędrzejewski-Szmek
Also reworded a few debug messages for brevity, and added a log statement which prints out the filter at debug level: Journal filter: (((UNIT=sys-module-configfs.device AND _PID=1) OR (COREDUMP_UNIT=sys-module-configfs.device AND MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1) OR _SYSTEMD_UNIT=sys-module-configfs.device) AND _BOOT_ID=4e3c518ab0474c12ac8de7896fe6b154)
2013-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-16macro: rework how we define cleanup macrosLennart Poettering
There's now a generic _cleanup_ macro with an argument. The macros for specific types are now defined using this macro, and in the header files where they belong. All cleanup handlers are now inline functions.
2013-03-18journal,shared: add _cleanup_journal_close_Zbigniew Jędrzejewski-Szmek
2013-03-13logs-show: export logic to add matches for unitsZbigniew Jędrzejewski-Szmek
After that functions which add matches, show_journal_by_unit and show_journal_by_user_unit, become nearly identical, so I merged them into one function.
2013-02-07logs-show: show messages for all unit types in systemctl statusMirco Tischler
I can't find a reason why we shouldn't try to output messages for other unit types than .service, .socket, .mount and .swap as well. It's probably a leftover from before we started logging UNIT= from inside PID 1.
2013-02-07journal: log user units for coredumps and show them in systemctl statusMirco Tischler
2013-01-18logs-show: add show_journal_by_user_unitMirco Tischler
Print the journal for a user session unit. For now this filters by _SYSTEMD_USER_UNIT and USER_UNIT and additionally _UID.
2013-01-16logs-show: automatic cleanupZbigniew Jędrzejewski-Szmek
2012-12-23journalctl: strip TABs and ANSI color sequences from log messages when ↵Lennart Poettering
displaying them
2012-11-21journal: by default do not decompress dat objects larger than 64KLennart Poettering
This introduces a new data threshold setting for sd_journal objects which controls the maximum size of objects to decompress. This is relieves the library from having to decompress full data objects even if a client program is only interested in the initial part of them. This speeds up "systemd-coredumpctl" drastically when invoked without parameters.
2012-11-15journal: implement message catalogLennart Poettering
The message catalog can be used to attach short help texts to log lines, keyed by their MESSAGE_ID= fields. This is useful to help the administrator understand the context and cause of a message, find possible solutions and find further related documentation. Since this is keyed off MESSAGE_ID= this will only work for native journal messages. The message catalog supports i18n, and is useful to augment english language system messages with explanations in the local language. This commit only includes short explanatory messages for a few example message IDs, we'll add more complete documentation for the relevant systemd messages later on.
2012-10-25journal: properly serialize fields with multiple values into JSONLennart Poettering
This now matches the JSON serialization spec from: http://www.freedesktop.org/wiki/Software/systemd/json
2012-10-18journalctl: don't ellipsize unless on a ttyLennart Poettering
2012-10-18journal: add ability to list unique fields to gatewaydLennart Poettering
2012-10-11journal: support epxorting the journal in a format suitable for ↵Lennart Poettering
text/event-stream
2012-09-28logs-show: various cleanupsLennart Poettering
Among other cleanups this introduces a threshold for the size of binary blobs we serialize as integer arrays in the JSON output. THis can be disabled via --all.
2012-09-18journalctl: don't choke on entries with no MESSAGE= fieldLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=50177
2012-09-05journalctl: rework JSON output modeLennart Poettering
This splits the JSON output mode into different modes: json and json-pretty. The former printing one entry per line, the latter showing JSON objects nicely indented and in multiple lines to make it easier to read for humans.
2012-09-03shared: logs-show: fflush after each output typeBrandon Philips
journalctl -f redirected to a pipe or file wasn't working for some output formats but was working for json. It turns out only json was doing an fflush. Make all output formats flush.
2012-09-03journalctl: include logs from PID 1 about services in systemctl statusLennart Poettering
2012-08-08fix a couple of issues found with llvm-analyzeLennart Poettering
2012-08-03logs-show: fix off-by-one errorShawn Landen
Ellipsize lines that are one character too long.
2012-07-26journalctl: hightlight log lines by priorityLennart Poettering
warn/notice = bright white < error = red
2012-07-26logs-show: fix OOM pathLennart Poettering
2012-07-26log.h: new log_oom() -> int -ENOMEM, use itShawn Landden
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
2012-07-25use "Out of memory." consistantly (or with "\n")Shawn Landden
glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
2012-07-20journalctl: fix assertion failure in ellipsize_mem()Eelco Dolstra
When showing the journal through "journalctl --no-pager", if the prefix of the log message (i.e. the date and syslog identifier) is less than 3 characters shorter than the width of the terminal, you get: Assertion 'new_length >= 3' failed at src/shared/util.c:3859, function ellipsize_mem(). Aborting. because there is not enough space for the "...". This patch add the necessary check.
2012-07-17journalctl: do not ellipsize when using pagerZbigniew Jędrzejewski-Szmek
If a pager is used, ellipsization is redundant — the pager does that better by hiding the part that cannot be shown. Pager's advantage is that the user can press → to view the hidden part of a message, and then ← to return.
2012-07-17logs: Adapt interface in log-show.c (show_journal_by_unit)Zbigniew Jędrzejewski-Szmek
Convert more flag arguments into one flag variable.
2012-07-17logs: Adapt interface in log-show.c (output_journal)Zbigniew Jędrzejewski-Szmek
In preparation for adding more output switches, convert a series of flags arguments into one flag variable.
2012-07-13man: document sd_journal_get_cutoff_realtime_usec()Lennart Poettering
2012-07-13journalctl: show any printable Unicode characterZbigniew Jędrzejewski-Szmek
This makes sure we are OK in outputting all valid, non-control UTF-8 characters, instead of just printable 7bit ASCII.
2012-07-10journal: introduce sd_journal_wait() to simplify writing synchronous clientsLennart Poettering
2012-06-17journal: expose and make use of cutoff times of journalLennart Poettering
This helps explaining when the log output of "systemctl status" is incomplete because the logs got rotated since the service was started.
2012-04-13fix a couple of things found with the llvm static analyzerLennart Poettering
2012-04-12move more common files to shared/ and add them to shared.laKay Sievers