logapp(1)
logapp π the manual page, bestie edition
okay so welcome to logapp(1) β yes that's the manual section, section 1, we love her π
β and she's an application output supervisor. Let's get into it.
β¨ NAME β¨
logapp β an application output supervisor. π«Ά
β¨ SYNOPSIS β¨
logapp [option]... application [--logapp_option]... [app.-argument]...
applicationsymlink [--logapp_option]... [application-argument]...
so, plot twist: you don't have to call logapp directly π you can also make a symlink named after the application, pointing at logapp. logapp will then automatically start the application that the name points to. and yes, it still works if the symlink name is prefixed with log. iconic behavior honestly π
β¨ DESCRIPTION β¨
so here's the vibe: logapp is a wrapper utility that helps you supervise the execution of applications that produce heavy console output β think make, CVS and Subversion. it does this by logging, trimming, and coloring each line of the output before displaying it. π
it can be called instead of the executable you want monitored β then it starts the application and logs all of its console output to a file. the output shown in the terminal gets pre-processed, like, to limit the length of printed lines and to show the stderr output in a different color. you can also set it up to automatically highlight lines matching a certain regular expression. π
so the output gets reduced to the necessary amount, and all the important lines are easy to identify. no cap, that's the whole point. periodt. π
β¨ OPTIONS β¨
okay so first, the rules of engagement π
options placed before the application argument get processed directly by logapp. options placed after the application argument are only parsed if they're prefixed with --logapp_ (long option names only) β otherwise they get passed straight to the application. and if logapp is called via a symlink, all unprefixed options go to the application. π¦
every application usually uses two independent output streams: stdout for normal output and stderr for errors and important messages. both of them are handled independently by logapp, which is why there are so many options available for both streams. (it's giving twin flames, honestly. π)
Bool options accept 1/0 and true/false as value. for long boolean options the value can be omitted β in that case it will be assumed to be 'true'. π
πΈ GENERAL OPTIONS πΈ
-?,--helpβ show a short overview over all available options. your lil cheat sheet π«Ά--versionβ show version information. β--configfile=FILEβ use a specific configuration file instead of searching the configuration search paths. π--showconfigβ print the current configuration of logapp and exit before the application is executed. this is the move when you wanna check if all configuration options are set up correctly and something doesn't work as expected. π--configsection=NAMEβ enable a specific section in the configuration file. if this option isn't provided, the application name is used as default. π--disableβ this disables logapp data handling completely. the application is still started, but logapp won't touch the data streams coming from the application. neither logging nor output formatting is performed β only the execution time and the exit state are tracked. this is useful if logapp won't be able to deal with expected data correctly, for example when starting curses based applications. have a look at--disable_keywordsto see how this option can be enabled automatically. π--disable_keywords=keywordlistβ with this option you can provide a list of comma separated keywords which will cause--disableto be enabled automatically if found in the application's option list. useful if an application usually provides line-based output but creates binary data or uses a curses based frontend when called with a specific parameter. you can also use the--detectescapeoption for another way to do this without disabling the logging functionality. π‘--detectescape=boolβ switch escape-sequence detection on or off. with escape-sequence detection, logapp will automatically enable char-based stream handling as soon as an escape-sequence is part of the specific stream. this behavior is useful when you're working with an application that's usually line-based but starts other applications which may be using escape sequences to format the screen. this option will prevent the terminal from being messed up in that case. πβ‘οΈπ--dumbterm=boolβ with this set totruethere will be no terminal output coloring for stdout and stderr. normally this option is disabled and logapp tries to detect "dumb" terminals itself. ποΈ--usepty=boolβ this option is only available if logapp has been compiled with PTY support. if PTY support is enabled with this option set totrue, logapp will open a pseudo terminal for stdout. this helps when running logapp with applications that usually need a real terminal for output. you can disable this option for most line based applications likemake, CVS or Subversion. other applications liketelnetorpicocommay produce strange results when used without PTY support. π»--ptyremovecr=boolβ also only available if logapp has been compiled with PTY support. when using a pseudo terminal for getting the application output you will always get CR-LF line endings, which is usually not desired when working in UNIX environments. with this option enabled, logapp will automatically translate all CR-LF line endings into LF line endings. this option is enabled as default. π§--stdout_blen=bytesand--stderr_blen=bytesβ the line buffer size can be adjusted for stdout and stderr independently with this option. if the value is too small, lines will be split up if the buffer is full. the default is2048byte which should be big enough for most applications. π--stdout_charbased=booland--stderr_charbased=boolβ if you want to use logapp with applications that do not produce line based output, you can enable these options for stdout and stderr independently. with this option enabled, logapp won't expect complete lines and will handle data as it comes in. by default all single data packets are written to a new line if this option is enabled β this can be changed with the--alignlogoption. whether the result will be usable depends on what kind of data is generated by the application. π€·βοΈ--extended-regexp=boolβ if enabled, logapp will interpret provided regular expression patterns as extended regular expressions. the default is to use basic regular expressions. π€
π LOGGING OPTIONS π
this section contains options that affect the logfile. π
-l,--logfile=fileβ change the file that's used for storing the logged application data. if an empty string is provided, logging is disabled and no logfile will be created. the default is that logapp creates a logfile calledlogapp.login the current directory. ποΈ-a,--appendlog=boolβ specifies if the logfile will be truncated or if the data will be appended to an existing file on logapp startup. β--maxlogsize=kibyteβ to limit the maximum size of the logfile, set this option to a value between10and4000000kiBytes. the default is0which disables the logfile size limit. there are different ways implemented for how the logfile is limited β have a look at the options--logrenameand--circularlogto learn more. the default way is that the extension.oldis added to the logfile and a new logfile is started. π₯--logrename=boolβ specifies the behavior when a logfile is to be truncated. if--logrenameis enabled, the logfile is renamed. the new filename will be the same as before with the extension defined with--oldlogextadded. the default extension is.old. this option is used together with the value of--appendlogand--maxlogsize. π--circularlog=boolβ if enabled together with a logfile size limit set with--maxlogsize, the logfile will be used in a circular way. this means if the maximum size is reached, the file pointer is set to the beginning of the file and the old content is overwritten from the beginning. there are tags added to the logfile to help navigating in the file. π--oldlogext=extensionβ defines the extension that's used when logapp is renaming a logfile. the--logrenameoption defines if logapp will rename the file, and the default extension is.old. π·οΈ--locklogfile=boolβ with this option active, the logfile is locked to prevent it from being overwritten by another task. useful, because otherwise an unreadable mix up of different contents would be the result. π΅ depending on the value of the--maxaltlogfilesoption, another logfile is chosen with the same name and a number added. logfile locking is activated by default. π--warnlogfilelock=boolβ defines if there should be a warning printed to the console if the chosen logfile is already locked or is otherwise not accessible. in this case there will be a message before the application is started and directly after its execution, where the name of the alternative logfile is mentioned. this option is enabled by default. also have a look at--printlogname, where you can define to always get the current logfile reported. β οΈ--printlogname=boolβ defines if the name of the used logfile should be printed after the application has finished its execution. this option is disabled by default. also have a look at--warnlogfilelockwhere you can enable/disable a warning if the logfile name is changed because of a locked logfile. π’
bestie, this page is long, so more parts are coming β stay tuned ππ¦
--maxaltlogfiles=numberβ bestie, this one sets the max number that can be added to the logfile name if the original file isnβt accessible. On logapp startup it checks if the currently defined logfile is writeable. If itβs not, a number is automatically added to the filename. If the alternative file is also not accessible, that number keeps increasing until a file is writable or you hit the value ofmaxaltlogfiles. In that latter case, the application will exit with an error π. If you use a value of0, only the original logfile name is tried. Also, go peek at the--warnlogfilelockand--printlognameoptions to define if there should be messages about the currently used logfile. π--alignlog=boolβ this one works together with--stdout_charbasedand--stderr_charbased. It defines if data packets are written to the logfile as they come, or if each one is written to a new line. The default is that each data packet gets its own new line, so set this tofalseto disable that. β¨--alignlinebreaks=boolβ also used with--stdout_charbasedand--stderr_charbased. It aligns the lines to the left in the logfile with regard to prefix and timestamp. This option is enabled by default. π¦--jointimeout=timeβ used with--stdout_charbasedand--stderr_charbased. It defines a ms timeout for joining single packets into one. So if two chars get written within the timeout, theyβre treated as one packet. Best used with--alignlogand--logtime. Use this if the data packets have lost their coherency for some reason (like if data comes through a serial line). This feature is disabled by default and can be enabled by setting time to a value bigger than0ms. π-t,--logtime=boolβ enable this to add a ms timestamp to each line of the logfile. Normally the time since the application start is used, but you can change that with the--logreltimeoption. β°--logreltime=boolβ if you set this to true, the--logreltimeoption will use the relative time since the last line for the logged timestamps. π°οΈ--logenv=boolβ set this to true and logapp will add a list of all active environment variables to the logfile. This option is disabled by default. π-p,--stdout_lineprefix=prefixβ to distinguish stdout and stderr output in the logfile, logapp can prefix each line with a string that indicates if the line belongs to a specific data stream. You can change that string for stdout with this option. The default is that stdout does not have a prefix and stderr is prefixed withSTDERR:. π-P,--stderr_lineprefix=prefixβ same idea, but this one changes the prefix string for stderr. The default is that stdout does not have a prefix and stderr is prefixed withSTDERR:. π
π CONSOLE OUTPUT OPTIONS π
This section contains options that affect the visual output on the console. π
--dumbterm=boolβ this disables output coloring. Usually done automatically if a dumb terminal is detected. π₯οΈ-s,--print_summary=boolβ if set to true, a short summary will be printed after the application has terminated. This option is disabled by default. π-f,--stdout_fgcol=colorβ defines the foreground color for the stdout data stream. The value can be one of the entries in the console color table at the end of this section. π¨-F,--stderr_fgcol=colorβ defines the foreground color for the stderr data stream. The value can be one of the entries in the console color table at the end of this section. π¨-b,--stdout_bold=boolβ defines if the font for the stdout data stream should be printed bold. BOLD energy! πͺ-B,--stderr_bold=boolβ defines if the font for the stderr data stream should be printed bold. πͺ-r,--stdout_regexp=regular expressionβ the regular expression you define here is applied to every line of the stdout data stream. On a match, the background color changes to the value provided with the--stdout_regexp_bgcoloption. π-R,--stderr_regexp=regular expressionβ same but for stderr. On a match, the background color changes to the value provided with the--stderr_regexp_bgcoloption. π--stdout_regexp_bgcol=colorβ defines the background color for stdout for the case that the appropriate regular expression provided with--stdout_regexpmatches. The value can be one of the entries in the console color table at the end of this section. π¨--stderr_regexp_bgcol=colorβ defines the background color for stderr for the case that the appropriate regular expression provided with--stderr_regexpmatches. The value can be one of the entries in the console color table at the end of this section. π¨-c,--stdout_clip=widthβ defines at which column the output should be clipped for stdout to reduce the amount of data written to the console. If you provide-1, clipping is disabled for the stream. A value of-2sets the clipping to the current console width. You can also usedisableandautoinstead of the numeric values. The default is that stdout is limited to the console width and that clipping is deactivated for stderr. βοΈ-C,--stderr_clip=widthβ defines at which column the output should be clipped for stderr. If you provide-1, clipping is disabled. A value of-2sets clipping to the current console width. You can also usedisableandauto. The default is that stdout is limited to the console width and that clipping is deactivated for stderr. βοΈ
Console color table π¨
-1β (console) default0β black1β red2β green3β brown4β blue5β magenta6β cyan7β white
COMMAND EXECUTION OPTIONS
This section contains options that configure the execution of commands on regular expression matches. π―
--exitonexecfail=BOOLβ defines if logapp should exit and end the wrapped application if the return value of an executed command indicates a failure. As default, this option is disabled and logapp ignores the return state of executed commands. πͺ--preexec=commandβ the command you provide here is executed directly before the application is started. At this time the header is already written to the logfile and can be parsed by the command. π--postexec=commandβ the command you provide here is executed directly after the application has exited. At this time the logfile is already closed for writing, so all application output and the footer are already included and can be processed by the command. π-e,--stdout_execregexp=regular expressionβ the regular expression defined here is applied to every line of the stdout data stream. On a match, the command provided with the--stdout_execcommandoption is executed. An empty value for this option disables the regular expression matching. π―-E,--stderr_execregexp=regular expressionβ same for stderr. On a match, the command provided with the--stderr_execcomandoption is executed. An empty value disables matching. π―-x,--stdout_execcommand=commandβ defines the command that is executed on a regular expression match. The regular expression can be defined separately for stdout with the--stdout_execregexpoption. π»-X,--stderr_execcommand=commandβ defines the command executed on a match for stderr. The regular expression can be defined with the--stderr_execregexpoption. π»
π₯ REGULAR EXPRESSIONS π₯
Regular expressions are patterns that describe strings. Logapp uses these patterns to execute actions based on strings found in the data stream. The implementation is identical to the one used by grep. Logapp understands the "basic" and "extended" syntax of regular expressions as defined by POSIX. The default is to use the basic set, but you can switch to extended patterns with the --extended-regexp parameter. Please have a look at the grep(1) and regex(7) manpage for detailed information. π
πΈ EXAMPLES πΈ
Here are some string matches for "String":
^Stringβ Matches"String"at the beginning of a lineString$β Matches"String"at the end of a line^String$β Line contains only"String"[Ss]tringβ Matches"String"or"string"Str.ngβ The dot matches all characters, so this matches for example"String"or"Strong"Str.*ngβ The dot together with star matches any number of characters, so this matches for example"String"or"Streaming"^[A-Z] *β Matches any one of the characters from A to Z at the beginning of a line followed by zero or any number of spacesString\|Wordβ Matches"String"or"Word"when working with basic regular expressionsString|Wordβ Matches"String"or"Word"when working with extended regular expressions
π ENVIRONMENT π
TERMβ This variable is checked to see which type of console logapp is running in. Currently only the valuedumbis handled in a special way β by disabling console colors. If theTERMvariable is missing, a dumb terminal is also assumed. The setting can be overridden by enabling/disabling the dumb terminal mode using the--dumbtermoption. π
πΎ FILES πΎ
~/.logapprc,/etc/logapp.conf,/etc/logapp/logapp.confβ Configuration file locations that are tried if no--configfileoption is provided. π
π BUGS π
See the TODO file included in the source package. π
π SEE ALSO π
π AUTHOR π
Michael Brunner
π COPYING π
okay bestie, the legal bit, but make it cute bc we're doing it together π«Ά
- Copyright (C) 2007β2011 Michael Brunner β yeah, the whole span, 2007 through 2011, all his. give the man his flowers π
This program is free software ποΈ β you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. so like, v2, or whatever comes after, your call, no cap β¨
This program is distributed in the hope that it will be useful π but β and this is the important part, don't skip it β WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π
fr fr, no promises, no guarantees, no "it'll definitely work on your machine" energy. if it eats your logs that's between you and the universe. π
See the General Public License for more details β that's where the actual fine print lives, go read it, it's giving responsible bestie π
okay that's literally the whole page!! π we did it, we read an entire manpage together, that's main character behavior, I'm obsessed π
this one's logapp 0.16svn from January 2011, and yeah it's logapp(1) β the section 1, user commands, right where it belongs π¦
go log something, bestie, you've earned it πβ¨
π¦ where this page comes from
- debian bookworm: logapp 0.16-2
- debian trixie: logapp 0.16-3+b1
- ubuntu jammy: logapp 0.16-1
- ubuntu noble: logapp 0.16-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms