logman update counterlogman update counter

适用于: Windows Server (半年通道) ,Windows Server 2019,Windows Server 2016,Windows Server 2012 R2,Windows Server 2012Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

更新现有计数器数据收集器的属性。Updates an existing counter data collector's properties.


logman update counter <[-n] <name>> [options]


参数Parameter 说明Description
-s <computer name>-s <computer name> 在指定的远程计算机上执行命令。Perform the command on the specified remote computer.
-config <value>-config <value> 指定包含命令选项的设置文件。Specifies the settings file containing command options.
[-n] <name>[-n] <name> 目标对象的名称。Name of the target object.
-f <bin|bincirc>-f <bin|bincirc> 指定数据收集器的日志格式。Specifies the log format for the data collector.
-[-] u <user [password]>-[-]u <user [password]> 指定要以其身份运行的用户。Specifies the user to Run As. 输入 * 密码将生成密码提示。Entering an * for the password produces a prompt for the password. 如果你在密码提示符处键入密码,密码不会显示。The password is not displayed when you type it at the password prompt.
-m <[start] [stop] [[start] [stop] [...]]>-m <[start] [stop] [[start] [stop] [...]]> 更改为手动启动或停止,而不是计划的开始或结束时间。Changes to manual start or stop instead of a scheduled begin or end time.
-rf <[[hh:]mm:]ss>-rf <[[hh:]mm:]ss> 在指定的时间段内运行数据收集器。Runs the data collector for the specified period of time.
-b <M/d/yyyy h:mm:ss[AM|PM]>-b <M/d/yyyy h:mm:ss[AM|PM]> 开始在指定时间收集数据。Begins collecting data at the specified time.
-e <M/d/yyyy h:mm:ss[AM|PM]>-e <M/d/yyyy h:mm:ss[AM|PM]> 结束在指定时间收集的数据。Ends data collection at the specified time.
-si <[[hh:]mm:]ss>-si <[[hh:]mm:]ss> 指定性能计数器数据收集器的采样间隔。Specifies the sample interval for performance counter data collectors.
-o <path|dsn!log>-o <path|dsn!log> 指定 SQL 数据库中的输出日志文件或 DSN 和日志集名称。Specifies the output log file or the DSN and log set name in a SQL database.
-[-] r-[-]r 每日在指定的开始和结束时间重复数据收集器。Repeats the data collector daily at the specified begin and end times.
-[-] a-[-]a 追加现有的日志文件。Appends an existing log file.
-[-] o-[-]ow 覆盖现有的日志文件。Overwrites an existing log file.
-[-] v <nnnnnn|mmddhhmm>-[-]v <nnnnnn|mmddhhmm> 将文件版本信息附加到日志文件名称的末尾。Attaches file versioning information to the end of the log file name.
-[-] rc <task>-[-]rc <task> 运行每次关闭日志时指定的命令。Runs the command specified each time the log is closed.
-[-] 最大值 <value>-[-]max <value> 最大日志文件大小(MB)或 SQL 日志的最大记录数。Maximum log file size in MB or maximum number of records for SQL logs.
-[-] .cnf <[[hh:]mm:]ss>-[-]cnf <[[hh:]mm:]ss> 指定 time 后,在指定的时间已过后创建新的文件。When time is specified, create a new file when the specified time has elapsed. 如果未指定时间,则在超出最大大小时创建新文件。When time is not specified, create a new file when the maximum size is exceeded.
-y-y 在不提示的情况下回答 "是"。Answers yes to all questions without prompting.
-cf <filename>-cf <filename> 指定列出要收集的性能计数器的文件。Specifies the file listing performance counters to collect. 该文件应包含每行一个性能计数器名称。The file should contain one performance counter name per line.
-c <path [path [ ]]>-c <path [path [ ]]> 指定要收集) (性能计数器。Specifies performance counter(s) to collect.
-sc <value>-sc <value> 指定要使用性能计数器数据收集器收集的样本的最大数目。Specifies the maximum number of samples to collect with a performance counter data collector.
/?/? 显示区分上下文的帮助。Displays context-sensitive help.


  • 其中列出了 [-],添加了额外的连字符 ( ) 对该选项求反。Where [-] is listed, adding an extra hyphen (-) negates the option.


若要使用处理器 (_Total) 计数器类别中的% Processor time 计数器创建名为 perf_log 的计数器,请键入:To create a counter called perf_log using the % Processor time counter from the Processor(_Total) counter category, type:

logman create counter perf_log -c \Processor(_Total)\% Processor time

若要更新名为 perf_log的现有计数器,请将采样间隔更改为10,将日志格式更改为 CSV,并向 mmddhhmm 格式的日志文件添加版本控制,请键入:To update an existing counter called perf_log, changing the sample interval to 10, the log format to CSV, and adding versioning to the log file name in the format mmddhhmm, type:

logman update counter perf_log -si 10 -f csv -v mmddhhmm

其他参考Additional References