Partilhar via


Create a trace log

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To create a trace log

  • Using the Windows interface

  • Using a command line

Using the Windows interface

  1. Open Performance.

  2. Double-click Performance Logs and Alerts, and then click Trace Logs.

    Any existing trace logs will be listed in the details pane. A green icon indicates that a log is running; a red icon indicates that a log has stopped.

  3. Right-click a blank area of the details pane, and click New Log Settings.

  4. In Name, type the name of the trace log, and then click OK.

    By default, the log file is created in the PerfLogs folder in the root directory on your system drive, a sequence number is appended to the file name you entered, and the sequential trace file type with the .etl extension. Use the Log Files and Advanced tabs to modify these parameters or define other parameters for your log. To define providers and events to log, use the General tab. To specify when you want logging to occur, use the Schedule tab.

Notes

  • To perform this procedure, you must be a member of the Administrators group, or the Performance Log Users group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open Performance, click Start, click Control Panel, double-click Administrative Tools, and then double-click Performance.

  • To save the settings for a counter log, trace log, or alert, right-click the log or alert in the details pane and click Save Settings As. You can then specify an .htm file in which to save the settings. To reuse the saved settings for a new log or alert, right-click the details pane, and then click New Log Settings From or New Alert Settings From. This is an easy way to generate new settings from a log or alert configuration. You can also open the HTML file in Internet Explorer to display a System Monitor graph.

Using a command line

  1. Open Command Prompt.

  2. To create a trace log type:

    Logmancreatetracecollection_name

Value Description

createtrace

Creates a trace log collection query.

collection_name

Specifies the name of the collection query.

For example, to create a trace log collection query named perf_log, type:

logman create trace perf_log

Once the collection query is created, providers then need to be enabled.

Notes

  • To perform this procedure, you must be a member of the Administrators group, or the Performance Log Users group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • To view the complete syntax for this command, at a command prompt, type:

    Logman /?

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Set parameters for a log
Select trace log providers and events
View or change properties of a log or alert
Logman