- Setting the Event Level for a Text Log
- Event Logging (Windows Installer)
- Set-Event Log Level
- Syntax
- Description
- Examples
- Example 1
- Parameters
- Inputs
- Outputs
- How to configure Active Directory and LDS diagnostic event logging
- Summary
- Active Directory diagnostic event logging
- Logging levels
- How to configure Active Directory diagnostic event logging
Setting the Event Level for a Text Log
SetupAPI writes a log entry to a text log only if the event level set for a text log is greater than or equal to the event level for the log entry, and the event category for the log entry is enabled for the text log.
The following table lists the event levels that SetupAPI supports and the manifest constants that represent these event levels. TXTLOG_ERROR is the lowest event level, followed by the next highest event level TXTLOG_WARNING, and so on. TXTLOG_VERY_VERBOSE is the highest event level.
Event level | Event level manifest constant | Event level manifest value | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Text log | Default value (Windows 7 and later versions) | Default value (Windows Vista SP2) | Default value (Windows Vista SP1 and previous versions) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0xVW value | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0xGH value | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LogLevel value | Event levels set for the text logs | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
The Identity parameter specifies the name of the event logging category for which you want to set the event logging level.
Type: | ECIdParameter |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
The Level parameter specifies the log level for the specific event logging category. The valid values are:
- Lowest
- Low
- Medium
- High
- Expert
Type: | ECIdParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don’t need to specify a value with this switch.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
Inputs
To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.
Outputs
To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.
How to configure Active Directory and LDS diagnostic event logging
This step-by-step article describes how to configure Active Directory diagnostic event logging in Microsoft Windows Server operating systems.
Original product version: В Windows Server 2019, , Windows Server 2016, Windows Server 2012 R2, Windows 7 Service Pack 1
Original KB number: В 314980
Summary
Active Directory records events to the Directory Services or LDS Instance log in Event Viewer. You can use the information that is collected in the log to help you diagnose and resolve possible problems or monitor the activity of Active Directory-related events on your server.
By default, Active Directory records only critical events and error events in the Directory Service log. To configure Active Directory to record other events, you must increase the logging level by editing the registry.
Active Directory diagnostic event logging
The registry entries that manage diagnostic logging for Active Directory are stored in the following registry subkeys.
Domain controller: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics
LDS: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ \Diagnostics
Each of the following REG_DWORD values under the Diagnostics subkey represents a type of event that can be written to the event log:
- Knowledge Consistency Checker (KCC)
- Security Events
- ExDS Interface Events
- MAPI Interface Events
- Replication Events
- Garbage Collection
- Internal Configuration
- Directory Access
- Internal Processing
- Performance Counters
- Initialization/Termination
- Service Control
- Name Resolution
- Backup
- Field Engineering
- LDAP Interface Events
- Setup
- Global Catalog
- Inter-site Messaging
- Group Caching
- Linked-Value Replication
- DS RPC Client
- DS RPC Server
- DS Schema
- Transformation Engine
- Claims-Based Access Control
Logging levels
Each entry can be assigned a value from 0 through 5, and this value determines the level of detail of the events that are logged. The logging levels are described as:
- 0 (None): Only critical events and error events are logged at this level. This is the default setting for all entries, and it should be modified only if a problem occurs that you want to investigate.
- 1 (Minimal): High-level events are recorded in the event log at this setting. Events may include one message for each major task that is performed by the service. Use this setting to start an investigation when you do not know the location of the problem.
- 2 (Basic)
- 3 (Extensive): This level records more detailed information than the lower levels, such as steps that are performed to complete a task. Use this setting when you have narrowed the problem to a service or a group of categories.
- 4 (Verbose)
- 5 (Internal): This level logs all events, including debug strings and configuration changes. A complete log of the service is recorded. Use this setting when you have traced the problem to a particular category of a small set of categories.
How to configure Active Directory diagnostic event logging
To configure Active Directory diagnostic event logging, follow these steps.
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information, see How to back up and restore the registry in Windows.
Select Start, and then select Run.
In the Open box, type regedit, and then select OK.
Locate and select the following registry keys.
Domain controller: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics
LDS: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ \Diagnostics
Each entry that’s displayed in the right pane of the Registry Editor window represents a type of event that Active Directory can log. All entries are set to the default value of 0 (None).
Configure event logging for the appropriate component:
- In the right pane of Registry Editor, double-click the entry that represents the type of event for which you want to log. For example, Security Events.
- Type the logging level that you want (for example, 2) in the Value data box, and then select OK.
Repeat step 4 for each component that you want to log.
On the Registry menu, select Exit to quit Registry Editor.
- Logging levels should be set to the default value of 0 (None) unless you are investigating an issue.
- When you increase the logging level, the detail of each message and the number of messages that are written to the event log also increase. A diagnostic level of 3 or greater is not recommended, because logging at these levels requires more system resources and can degrade the performance of your server. Make sure that you reset the entries to 0 after you finish investigating the problem.