This page in English
Logtext - Dokumentation - Kommandozeilen-Programm
Heimseite - Download - Dokumentation - Forum - Fehler melden - Impressum - Lizenzvereinbarung - Externe Verweise
 
 
 
 
Kommandozeilen-Programm Logtext.exe
 
Installation
 
Eine Installation ist nicht nötig. Kopieren Sie einfach die Datei LOGTEXT.EXE in das Windows-System-Verzeichnis (normalerweise C:\Windows\System32 oder C:\Winnt\System32), oder verwenden Sie das Installationsprogramm von der Download-Seite, das das Programm dort automatisch hinkopiert.
Sie können es eigentlich in jedes beliebige Verzeichnis auf Ihrem Computer kopieren, solange es in der Umgebungsvariablen Path aufgenommen ist. Wenn Sie LOGTEXT.EXE nur für ein bestimmtes Programm/eine bestimmte Batch-Datei benötigen, dann könnten Sie die Datei auch nur in das Verzeichnis dieses Programms/dieser Batch-Datei kopieren. In den meisten Fällen ist es jedoch das beste, wenn eine Kopie im Windows-System-Verzeichnis liegt. Dadurch ist sichergestellt, daß von überall auf dem System darauf zugegriffen werden kann, und Sie müssen sich nicht mehr darum kümmern, wo die Datei nun genau liegt. Das Windows-System-Verzeichnis ist bereits in der Path-Umgebungsvariablen aufgenommen.
 
 
Aufruf
 
Logtext.exe aufrufen Geben Sie in einem Kommandozeilen-Fenster logtext oder logtext|more ein, dann drücken Sie die Eingabetaste. Logtext wird sich mit dem unten aufgeführtem Text melden. Die Parameter und Optionen dürften mehr oder weniger selbsterklärend sein. Unter Beispiele weiter unten finden Sie dazu mehr Informationen.  
 
Interface for LogText 1.6.21 - built 2007-12-28 19:26:20
Obtain latest release from http://www.logtext.de.
Contact: Thomas@Logtext.de

Batch utility to process log files.

USAGE:
	logtext logfile/application text [options] [maxlogs] [maxzips]

PARAMETERS:

Logfile/application
              File name and optional path containing the
              log files. STDOUT sends the output to standard
              output (automatically implies ECHO_ONLY).

Options are one or more of the following:

ECHO               Logs and echoes the text.
ECHO_ONLY          Do not log or rotate, but echo only.
STDERR             Any echoed output is sent to stderr instead of
                    stdout (except for LOGFILE_NAME).
QUICK              No log rotation.
NO_DATE            No date stamp in log file name.
DAILY              Extend logfile name to fileYYYY-MM-DD (default).
WEEKLY             Extend logfile name to fileYYYY-WCW.
MONTHLY            Extend logfile name to fileYYYY-MM.
YEARLY             Extend logfile name to fileYYYY.
LOGNAME_ONLY       Don't log, but show log file's name.
INCLUDE_APP        Include application name in logged text.
LINES              Shrink logfile down to [maxlogs] lines.
SIZE               Shrink logfile down to [maxlogs] octets.
DELETE_LOGS        Delete all log files.
                    (Only works without maxlogs or maxzips.)
DELETE_ZIPS        Delete all compressed log files.
                   ( Only works without maxlogs or maxzips.)
DONT_ZIP           Do not compress log files.
LOGFILE_NAME       Display the log file's name.
TIME_T             Separate date and time by a capital 'T' as
                    mentioned in ISO 8601 instead of a blank.
STDIN              Ignore text but read lines to log from stdin.
USER_ISO_DATE      Set regional settings for date/time to ISO 8601
                    (current user only). Version 1.6 and higher
                    set the long date format as well.
REG_ISO_DATE       Set regional settings for date/time to ISO 8601
                    (as default for all users). Version 1.6 and
                   higher set the long date format as well.
DONT_LOG_ACTIONS   Implies DONT_LOG_DELETION, DONT_LOG_ZIPPING,
                    and DONT_LOG_REGISTRY.
LOG_DELETION       Log deletion of files (default).
LOG_REGISTRY       Log registry changes (default).
LOG_ZIPPING        Log compression of files (default).
DONT_LOG_DELETION  Don't log the deletion of files.
DONT_LOG_REGISTRY  Don't log registry changes.
DONT_LOG_ZIPPING   Don't log compression of files.
DONT_LOG_MS or     Don't add fractions of a second to time stamp
NO_MS              (hh:mi:ss instead of hh:mi:ss.mis).
DONT_LOG_SEC or    Don't add seconds, milliseconds, or offset to
NO_SEC             the time stamp (only hh:mm).
NO_OFFSET or       Don't add the offset to the time stamp.
NO_OFFS
THREE_BLANKS       Insert three blanks instead of just one between
                    date/time stamp and text to log.
KEEP_CRLF          Don't remove CR or LF characters from text.
NTFS_COMPRESS[ION] Use NTFS's internal compression instead of gzip.
/EE=module         External packer's executable module.
/EP=pars           External packer's command line parameters.
                    %1 will be replaced with the log file's name,
                    %2 with the archive's name.
/EX=.ext           External packer's preferred archive file name
                    extension.


maxlogs       Only keep this amount of log files.
              Defines the minimum number of octets or lines,
              if LINES or SIZE is given.
maxzips       Only keep this amount of compressed log files.
              Defines the maximum number of octets or lines,
              if LINES or SIZE is given.

EXAMPLES:

logtext STDOUT "Logtext built."
              Output:
              2007-12-28 19:26:20.044+01:00 Logtext built.

logtext STDOUT "Logtext built." DONT_LOG_MS
              Output:
              2007-12-28 19:26:20+01:00 Logtext built.

logtext STDOUT "Logtext built." NO_MS NO_OFFSET
              Output:
              2007-12-28 19:26:20 Logtext built.

logtext c:\temp\application "Text to log" ECHO 2
              Log daily, keep 2 uncompressed log files.

logtext c:\temp\application "Text to log" ECHO 2 10
              Log daily, keep 2 log files and 10 compressed files.

logtext application "Text to log" ECHO NO_SEC THREE_BLANKS
              Produces output compatible to Inno Setup's installation
              log files (see http://www.innosetup.org).

logtext application "Text to log" MONTHLY SIZE 1000000.
              Log monthly, maximum size of logfile is 1000000
              octets, suppress output.

logtext application "Text to log" WEEKLY LINES 100 200.
              Log up to 200 lines in a weekly logfile. If the
              amount of logged lines exceeds 200, remove the least
              recent lines so that a minimum of 100 lines remain.

logtext app "Text" "/EE=zip.exe" "/EP=-9 %2 %1" /EX=.zip 2 2
              Keep 2 uncompressed and 2 compressed log files,
              use zip.exe as an external packer by invoking it
              with 'zip.exe -9 app.log.zip app.log'.

batchfile.bat | logtext application "" ECHO STDIN
              Log output (standard output only) of batchfile.bat.

batchfile.bat 2>&1| logtext application "" ECHO STDIN
              Log output (stderr and stdout) of batchfile.bat.

logtext STDOUT "Registry set." USER_ISO_DATE REG_ISO_DATE
              Set registry values for the operating system to use
              ISO 8601 date/time instead of local format. Don't
              write into a log file.
	
Beispiele
 
Datum und Uhrzeit in Umgebungsvariablen speichern.
 
Hier ist ein Beispiel, wie man Datum und Uhrzeit in einer Batch-Datei in Umgebungsvariablen speichern kann. Diese Methode ist - anders als mit reinen Windows-Bordmitteln - vollkommen unabhängig von den im Betriebssystem eingestellten Formaten für Datum und Uhrzeit. Die Batch-Datei funktioniert unter allen Windows-Systemen gleichermaßen (beginnend mit Windows NT), solange Logtext installiert ist. Unter Windows 95, Windows 98 und Windows ME kann sie freilich wegen der "FOR"-Schleife nicht laufen.
 
Sie können die Datei von hier (isodatetime.cmd) herunterladen.
@ECHO OFF
LOGTEXT stdout "" ECHO_ONLY
FOR /F "eol=; tokens=1-9,* delims=-:.+ " %%a IN ('LOGTEXT stdout "" ECHO_ONLY') DO (
	SET iYear=%%a
	SET iMonth=%%b
	SET iDay=%%c
	SET iHour=%%d
	SET iMin=%%e
	SET iSec=%%f
	SET iMis=%%g
	SET iOfH=%%h
	SET iOfM=%%i
)
ECHO.
ECHO isodatetime - Example for LOGTEXT.EXE
ECHO  See http://www.logtext.de for more info.
ECHO.
ECHO Date:     %iYear%-%iMonth%-%iDay%
ECHO.
ECHO Year:     %iYear%
ECHO Month:    %iMonth%
ECHO Day:      %iDay%
ECHO.
ECHO Time:     %iHour%:%iMin%:%iSec%.%iMis%
ECHO.
ECHO Hour:     %iHour%
ECHO Minute:   %iMin%
ECHO Second:   %iSec%
ECHO Fraction: %iMis%
ECHO.
ECHO Offset to UTC: %iOfH% hours and %iOfM% minutes.
ECHO.
	
 
 
Externe Verweise
 
Logtext Beispiele bei http://www.knaggs.de
 
 
 
 
 
 
 
 

Heimseite - Download - Dokumentation - Forum - Fehler melden - Impressum - Lizenzvereinbarung - Externe Verweise
This page in English