Variable: logview-additional-submodes
logview-additional-submodes is a customizable variable defined in
logview.el.
Value
nil
Documentation
Association list of log submodes (file parsing rules).
A few common submodes are already defined by the mode in variable
logview-std-submodes, but the ones you add here always take
precedence.
Submode definition has one required and several optional fields:
format
The only mandatory and the most important field that defines
how log entries are built from pieces. There are currently
four such supported pieces: "TIMESTAMP", "LEVEL", "NAME"
and "THREAD". All four are optional. For example, Log4j,
by default formats entries according to this pattern:
TIMESTAMP [THREAD] LEVEL NAME -
Additionally, you can use special placeholder "IGNORED" if
needed. Usecase for it are log files that contain too many
fields to map to the ones Logview supports natively.
Finally, you can explicitly specify "MESSAGE" field at the
very end of the format string. Normally, you can leave that
to Logview, just as in the example above. However, when the
mode adds the field itself, it also prepends it with a space,
which might be incorrect for some special custom submodes.
Regular expressions to match specified entry pieces are
generated by Logview based on surrounding characters (e.g.
spaces in the example for Log4j except for "THREAD", which
is surrounded by brackets). However, if these are not
suitable in your case, for "NAME", "THREAD" and "IGNORED"
you can explicitly specify the desired regexp. For example:
<<RX:IGNORED:[a-z]+>>
will ignore one or more Latin letters, but not anything else.
levels [may be optional]
Level mapping (see logview-additional-level-mappings) used
for this submode. This field is optional only if the submode
lacks levels altogether.
There are some predefined values valid for this field:
"SLF4J" (and its aliases "Log4j", "Log4j2",
"Logback", "JUL" and the syslog standard "RFC 5424".
See variable logview-std-level-mappings for details.
timestamp [optional]
If set, must be a list of timestamp format names to try (see
logview-additional-timestamp-formats). If not set or
empty, all defined timestamp formats will be tried.
aliases [optional]
Submode can have any number of optional aliases, which work just
as the name.
Source Code
;; Defined in /nix/store/3zkn9hgpv447zb8nrg55d9x2ynmmrk40-emacs-packages-deps/share/emacs/site-lisp/elpa/logview-20260218.2013/logview.el
(defcustom logview-additional-submodes nil
"Association list of log submodes (file parsing rules).
A few common submodes are already defined by the mode in variable
`logview-std-submodes', but the ones you add here always take
precedence.
Submode definition has one required and several optional fields:
format
The only mandatory and the most important field that defines
how log entries are built from pieces. There are currently
four such supported pieces: \"TIMESTAMP\", \"LEVEL\", \"NAME\"
and \"THREAD\". All four are optional. For example, Log4j,
by default formats entries according to this pattern:
TIMESTAMP [THREAD] LEVEL NAME -
Additionally, you can use special placeholder \"IGNORED\" if
needed. Usecase for it are log files that contain too many
fields to map to the ones Logview supports natively.
Finally, you can explicitly specify \"MESSAGE\" field at the
very end of the format string. Normally, you can leave that
to Logview, just as in the example above. However, when the
mode adds the field itself, it also prepends it with a space,
which might be incorrect for some special custom submodes.
Regular expressions to match specified entry pieces are
generated by Logview based on surrounding characters (e.g.
spaces in the example for Log4j except for \"THREAD\", which
is surrounded by brackets). However, if these are not
suitable in your case, for \"NAME\", \"THREAD\" and \"IGNORED\"
you can explicitly specify the desired regexp. For example:
<<RX:IGNORED:[a-z]+>>
will ignore one or more Latin letters, but not anything else.
levels [may be optional]
Level mapping (see `logview-additional-level-mappings') used
for this submode. This field is optional only if the submode
lacks levels altogether.
There are some predefined values valid for this field:
\"SLF4J\" (and its aliases \"Log4j\", \"Log4j2\",
\"Logback\", \"JUL\" and the syslog standard \"RFC 5424\".
See variable `logview-std-level-mappings' for details.
timestamp [optional]
If set, must be a list of timestamp format names to try (see
`logview-additional-timestamp-formats'). If not set or
empty, all defined timestamp formats will be tried.
aliases [optional]
Submode can have any number of optional aliases, which work just
as the name."
:type logview--additional-submodes-type
:set #'logview--set-submode-affecting-variable
:set-after '(logview-additional-timestamp-formats logview-additional-level-mappings))