Short: Different logfile entries in ONE window Author: atte@crash.north.de (Andreas Gelhausen) Uploader: cosinus deepthought north de (Christian Stelter) Type: util/misc Architecture: m68k-amigaos System requirements: Kickstart 2.04+ Usage ===== Do you have many tools installed and each of them prints in an own logfile (or in a logwindow)? Do you want all these entries displayed in only one logwindow? Then you should try alog with all its options. =¦^) alog is a small program that allows you to get the new entries from a certain logfile and prints it wherever you want (similar to 'tail' under UNIX). You can select the following options: TOOLPRI/K/N: You can set the task priority of alog from -128 to 127. Example: 1> alog toolpri=1 FROM/K/A: Here you have to specify the logfile, where alog gets the new entries from. TO/K: This option allows you to specify an output file for alog that will be opened and closed for each line alog writes into it. PERMANENT/S: If one of your tools runs in the background ('AmiTCP' for example) and its logfile won't be closed during its usage or the used filesystem doesn't support notify messages, alog won't get notify messages when new entries will be written to the specified logfile. For those tools/filesytems you can select the option PERMANENT and alog will check if new entries have arrived from time to time. (See also option INTERVAL.) Example: 1> alog from t:AmiTCP.log permanent addedonly will print each new entry of t:AmiTCP.log to shell. (See also option ADDEDONLY.) INTERVAL/K/N: If you have selected the option PERMANENT, you can set the time between the tests for new entries. Example: 1> alog from t:AmiTCP.log permanent addedonly interval 10 will print the new entries of t:AmiTCP.log each 10 seconds to shell. (See also option ADDEDONLY.) ADDEDONLY/S: If you select this option, only the new entries which will be added to a given logfile will be printed. HEADER/K: This option allows you to set an own header for the messages. Example: 1> run alog from t:test header "TEST-HEADER: " [CLI 11] 1> echo "blafasel" >t:test and you will get the message "TEST-HEADER: blafasel". STRIPLEFT/K/N: Some tools have their own headers. You can strip those headers by setting STRIPLEFT to their length. Example: 1> run alog from t:test stripleft 30 [CLI 11] 1> echo "HEADER-YOU-DON'T-WANT-TO-SEE: blafasel" >t:test and you will receive the message "blafasel". MAXLINELEN/K/N: This option allows you to handle very long messages. It's useful by using small logwindows. Example: 1> run alog from t:test maxlinelen 12 [CLI 11] 1> echo "FIRST LINE SECOND LINE THIRD LINE" and you will receive the message "FIRST LINE SECOND LINE THIRD LINE". Now I hope you know how you have to use all of alog's options and I will try to explain, what you have to do to get the logfile entries of all your tools into ONE logwindow. If you want to display the log messages of x tools, you have to start alog at x+1 times. How to install alog =================== 1. Add the following line to your s:user-startup... run alog from t:alog.out >CON:0/0/640/100/message_window/WAIT/CLOSE This is the main process of alog. Everything that is printed to t:alog.out will be printed to your message window. Try: 1> echo "WARNING: alog found in your system! =¦^)" >t:alog.out or: 1> date >t:alog.out 2. If you want to see the new entries of a certain logfile in your message window, you only have to start alog with following parameters: 1> run alog from to t:alog.out addedonly Don't forget: For some tools (like AmiTCP) you have to use the option PERMANENT. That's it. =¦^) Example installation ==================== Now you will see some examples for certain tools. The command line... run >nil: dh0:utilities/alog from t:alog.out >"CON:210/885/814/139/alog on crash.north.de/INACTIVE/WAIT/CLOSE" prints all entries from t:alog.out to the specified message window. The next command lines are examples for AmiTCP... run >nil: dh0:utilities/alog from t:AmiTCP.log to t:alog.out addedonly permanent interval 5 stripleft 34 header "*E[32m[ AmiTCP ]*E[0m " for UMS... run >nil: dh0:utilities/alog from Basket:logfiles/ums.log to t:alog.out addedonly permanent stripleft 20 header "*E[32m[ UMS ]*E[0m " and for Cron... run >nil: dh0:utilities/alog from t:CronLog to t:alog.out addedonly header "*E[32m[ Cron ]*E[0m " which all prints to 't:alog.out'.