Jaa


Configure Message Logging

This topic describes how to use AppFabric cmdlets to configure message logging for an application or a service. The cmdlets that you can use for configuring message logging are Set-ASAppMessageLogging, Get-ASAppMessageLogging, Enable-ASAppMessageLogging, and Disable-ASAppMessageLogging.

To execute an AppFabric cmdlet interactively, open the Windows PowerShell console for AppFabric, enter the appropriate cmdlet, and then press ENTER. For more information about executing cmdlets, see Running AppFabric Cmdlets.

To set message logging for an application

In the Windows PowerShell console, execute the Set-ASAppMessageLogging cmdlet to change the message logging properties for an application.

Syntax options for Set-ASAppMessageLogging:

Syntax 1

Set-ASAppMessageLogging [SiteName] <String> [[-VirtualPath] <String>] [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 2

Set-ASAppMessageLogging [-Uri] <Uri> [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 3

Set-ASAppMessageLogging -ApplicationObject <ApplicationInfo> -FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 4

Set-ASAppMessageLogging -Root [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]
Parameter Description

[-SiteName] <String> [[-VirtualPath] <String>]. [-Uri] <Uri>, -ApplicationObject <ApplicationInfo>, or -Root

Operational scope of the cmdlet

-FilePath <string>

Required. Where the logs should be stored.

-LogEntireMessage

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logEntireMessage] attribute. If missing then the attribute is not changed.

-LogMalformedMessages

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMalformedMessages] attribute. If missing then the attribute is not changed.

-LogMessagesAtServiceLevel

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMessagesAtServiceLevel] attribute. If missing then the attribute is not changed.

-LogMessagesAtTransportLevel

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMessagesAtTransportLevel] attribute. If missing then the attribute is not changed.

-MaxMessagesToLog Number

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@maxMessagesToLog] attribute. If missing then the attribute is not changed.

-MaxSizeOfMessageToLog Number

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@maxSizeOfMessageToLog] attribute. If missing then the attribute is not changed.

To obtain message logging from an application

In the Windows PowerShell console, execute the Get-ASAppMessageLogging cmdlet to obtain the message logging properties for an application into an ApplicationMessageLoggingInfo object.

Syntax options for Get-ASAppMessageLogging:

Syntax 1

Get-ASAppMessageLogging [-SiteName] <String> [[-VirtualPath] <String>]

Syntax 2

Get-ASAppMessageLogging [-Uri] <Uri>

Syntax 3

Get-ASAppMessageLogging -ApplicationObject <ApplicationInfo>

Syntax 4

Get-ASAppMessageLogging -Root
Parameter Description

[-SiteName] <String> [[-VirtualPath] <String>], [-Uri] <Uri>, -ApplicationObject <ApplicationInfo>, or -Root

Operational scope of the cmdlet

To enable message logging for an application

In the Windows PowerShell console, execute the Enable-ASAppMessageLogging cmdlet to enable the logging of messages for a specified application.

Syntax options for Enable-ASAppMessageLogging:

Syntax 1

Enable-ASAppMessageLogging [-SiteName] <String> [[-VirtualPath] <String>] [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 2

Enable-ASAppMessageLogging [-Uri] <Uri> [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 3

Enable-ASAppMessageLogging -ApplicationObject <ApplicationInfo> [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]

Syntax 4

Enable-ASAppMessageLogging -Root [-FilePath <string>] [-LogEntireMessage] [-LogMalformedMessages] [-LogMessagesAtServiceLevel] [-LogMessagesAtTransportLevel] [-MaxMessagesToLog Number] [-MaxSizeOfMessageToLog Number]
Parameter Description

[-SiteName] <String> [[-VirtualPath] <String>], [-Uri] <Uri>, -ApplicationObject <ApplicationInfo>, or -Root

Operational scope of the cmdlet

-FilePath <string>

Required. Where the logs should be stored.

-LogEntireMessage

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logEntireMessage] attribute. If missing then the attribute is not changed.

-LogMalformedMessages

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMalformedMessages] attribute. If missing then the attribute is not changed.

-LogMessagesAtServiceLevel

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMessagesAtServiceLevel] attribute. If missing then the attribute is not changed.

-LogMessagesAtTransportLevel

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@logMessagesAtTransportLevel] attribute. If missing then the attribute is not changed.

-MaxMessagesToLog Number

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@maxMessagesToLog] attribute. If missing then the attribute is not changed.

-MaxSizeOfMessageToLog Number

Optional. Specifies the value of the /configuration/system.serviceModel/diagnostics/messageLogging[@maxSizeOfMessageToLog] attribute. If missing then the attribute is not changed.

To disable message logging for an application

In the Windows PowerShell console, execute the Disable-ASAppMessageLogging cmdlet to disable the logging of messages in the context of the current diagnostics session.

Syntax options for Disable-ASAppMessageLogging:

Syntax 1

Disable-ASAppMessageLogging [-SiteName] <String> [[-VirtualPath] <String>] [-Confirm]

Syntax 2

Disable-ASAppMessageLogging [-Uri] <Uri> [-Confirm]

Syntax 3

Disable-ASAppMessageLogging -ApplicationObject <ApplicationInfo> [-Confirm]

Syntax 4

Disable-ASAppMessageLogging [-Confirm] -Root
Parameter Description

[-SiteName] <String> [[-VirtualPath] <String>], [-Uri] <Uri>, -ApplicationObject <ApplicationInfo>, or -Root

Operational scope of the cmdlet

  2012-09-12