Logman
Updated: January 21, 2005
Syntax Verbs
Parameters
Syntax Options
[-config FileName]
[-b M/D/YYYYH:MM:SS [{AM | PM}]]
[-e M/D/YYYYH:MM:SS [{AM | PM}]
[-m [start] [stop]]
[-[-]r]
[-o {Path | DSN!CounterLog}]
[-f {bin | bincirc | csv | tsv | SQL}]
[-[-]a]
[-[-]v [{NNNNNN | MMDDHHMM}]]
[-[-] rc [FileName]]
[-[-] max [Value]]
[-[-]cnf [[[HH:]]MM:]SS]
[-c {Path [Path ...] | -cfFileName}]
[-si [[HH:]]MM:]SS]
[-ln LoggerName]
[-ets]
[-[-] rt]
[-p {GUID | provider [(Flags [,Flags...])] Level | -pf [FileName]}]
[-[-] ul]
[-bs Value]
[-ft [[HH:]]MM:]SS]
[-nb Min Max]
[-fd LoggerName]
[-[-]uUserName Password]
[-rf [[HH:]]MM:]SS]
[-y]
[-mode [TraceMode [TraceMode ...]]]
[-ct {system | perf | cycle}]
Parameters
Remarks
-
You can use a subset of Logman commands to manage computers running Windows 2000 from a computer running Windows XP Professional. Windows 2000 does not support the following options:
-r
-o when specifying a Database System Name (DSN)
-f sql
-cnf
-ln
-ft
-fd
-ets
-mode
You can use the -u option to connect to the target computers; however, you cannot use it to set the credentials for the remote collection. The collection will run under whatever account you have configured the Performance Logs and Alerts service. By default, this is the Local System account.
-
Valid options for the command-line verbs create, update, start, stop, delete, and query are:
-sRemoteComputer
-[-]u Domain/UserName Password
-
Valid options for create and update, and common options for counter and trace are:
-y
-bM/D/YYYYHH:MM:SS [{AM | PM}]
-eM/D/YYYYHH:MM:SS [{AM | PM}]
-rfHH:MM:SS
-m [start] [stop
-f {bin | bincirc}
-[-]r
-oPathName
-[-]a
-[-]v {NNNNN | MMDDHHMM}
-[-]rc Command PathName
-[-]max N
-[-]cnf HH:MM:SS
- Common options for counters only are:
-f {bin | bincirc | csv | tsv | SQL}
-o {PathName | DSN!CounterLog }
-
Common options for create counter are:
-c {CounterPath | -cfInputFile}
-si [[HH:]MM:]SS
These options update the counter, and will stop and start collections.
-
Options for update for trace collection are:
- maxN
- oPathName
-ftMM:SS
-fd
These options will query trace collections without stopping the collections.
- Valid options with counters only are:
-f {bin | bincirc | csv | tsv | SQL}
-o {PathName | DSN!CounterLog }
-
Valid options with create counter commands are:
-c {CounterPath | -cfInputFile}
-si [[HH:]MM:]SS
-
Valid options for create trace commands are:
-lnLoggerName
-[-]rt
-p {GUID | provider(Flags[,Flags ...])Level | -pfFileName}
-[-]ul
-bsN
-ftMM:SS
-nbMin Max
-fdLoggerName
-ets
-
Using the -config option
The contents of the setting file used with the -config option should have the following format:
[CommandOption]
Value
where CommandOption is a command line option and Value specifies its value. For example:
[counter]
logx
[-s]
mysystem
[-u] UserName Password]
-
Using the -mode option
You should only use this option if you are an advanced user.
-
Using the -ct option
The default system clock type is sufficient for most providers that generate events. However, if a provider is capable of generating events at a rate greater than 1 per 10 ms, use a perf clock type.
- Managing Performance monitor
You can only use Logman to manage systems running Windows 2000, Windows XP, or the Windows Server 2003 family of operating systems.
-
For more information about incorporating Logman into your Windows Management Instrumentation (WMI) scripts, see "Scripting WMI" at the Microsoft Windows Resource Kits Web site .
Examples
Date formats in the following examples are for US local time only.To create daily counter collection queries with begin and end times, repeat collections, version control numbers, counter paths and sample intervals, type:
Logman create counter daily_perf_log -b 7/27/2000 13:00:00 -e 7/27/2000 15:00:00 -r -v mmddhhmm -c "\processor(_Total)\% processor Time" "\Memory\Available bytes" -si 00:15 -o "c:\perflogs\daily_log"
To create daily collection queries with begin and end times, repeat collections, output file collections, version control numbers, counter paths and sample intervals, type:
Logman create counter daily_perf_log -b 7/27/2000 13:00:00 -e 7/27/2000 15:00:00 -r -o "c:\perflogs\daily_log" -v mmddhhmm -c "\processor(_Total)\% processor Time" "\Memory\Available bytes" -si 00:15
To create daily collection queries using the config file, instead of the command line file, type:
Logman -config file daily_perf.txt
To create daily trace collection queries with begin and end times, repeat collections, version control numbers, provider names, input and output file collections, type:
Logman create trace daily_kernel_trace_log -b 7/27/2000 13:00:00 -e 7/27/2000 15:00:00 -r -v mmddhhmm -p "Windows Kernel Trace" 0xFFFFFFFF -rf 100 -o "c:\perflogs\daily_nt_trace"
To create daily trace collection queries with begin and end times, repeat collections, version control numbers, Guid and logger names, input and output file collections, type:
Logman create trace daily_lsass_trace_log -b 7/27/2000 13:00:00 -e 7/27/2000 15:00:00 -r -v mmddhhmm -p "Local Security Authority(LSA)" 0x00000001 -rf 30:00 -o " c:\perflogs\daily_lsass_trace"
To create daily counter collection queries with begin and end times, repeat collections, version control numbers, counter paths, sample intervals, SQL formats and output file collections, type:
Logman create counter daily_perf_log -b 7/27/2000 13:00:00 -e 7/27/2000 15:00:00 -r -v mmddhhmm -c "\processor(_Total)\% processor Time" "\Memory\Available bytes" -si 00:15 -f sql -o perfdb!daily_log
To start daily collections with sample intervals, account names and passwords, type:
Logman start daily_perf_log -s \\%computer_name% -u admin "adminpassword"
To start manual data collections, type:
Logman start daily_perf_log
To stop data collections, type:
Logman stop daily_perf_log
To delete data collections, type:
Logman delete daily_perf_log
To display the status of collection queries, type the following commands:
Logman query
Logman query daily_perf_log
Formatting legend
Format Meaning Italic Information that the user must supply Bold Elements that the user must type exactly as shown Ellipsis (...) Parameter that can be repeated several times in a command line Between brackets ([]) Optional items Between braces ({}); choices separated by pipe (|). Example: {even|odd} Set of choices from which the user must choose only one Courier font Code or program output