Logging

Get-XpLogging

Syntax

Get-XpLogging [[-LoggerNames] <string[]>] [-GatewayNames <string[]>] [-GatewayType {Any | CTI | SIP}] [-Timeout <int>]  [<CommonParameters>]

Description

The command performs a search for loggers on the XPhone Connect Server and displays the result as a list of LogLevel objects. By default, only the following properties are displayed:

Path
Level

Parameter

  • -LoggerNames <String[]> or [-GatewayNames <string[]>] or [-GatewayType {Any | CTI | SIP}]
    • Specifies the string to be searched for on the XPhone Connect Server.

    • Several names can be entered, separated by commas.

    • It is strongly recommended to use enclosing quotation marks, as special characters (e.g. spaces) often occur in the strings.

    • GatewayNames and GatewayType can be determined with Get-XpGateways.

  • -Timeout <int>
    • Timeout in minutes.

    • If a command takes too long (e.g. due to too many data records or similar), this command can be aborted with this parameter after the specified time.

  • <CommonParameters>

Inputs

This command does not support input via the pipeline and is therefore usually at the beginning of a command chain.

Outputs

The Get-XpLogging command returns objects of the LogLevel type.

Level

C4B.Atlas.Log.ATLogLevel Level {get;set;}

Modules

string Module {get;}

Name

string Name {get;}

Path

string Path {get;}

You can display a list similar to this with the following command:

Get-XpLogging | Get-Member

Example

  1. Show all loggers:

    Get-XpLogging
    
  2. Display the logger for all CTI gateways:

    Get-XpLogging -GatewayType CTI
    
  3. Show all loggers whose gateway name begins with OSBiz and OSV:

    Get-XpLogging -GatewayNames OSBiz*, OSV*
    
  4. Show all loggers that have the status Debug:

    Get-XpLogging | Where-Object {$_.Level -eq "Debug"}
    

Set-XpLogging

Syntax

Set-XpLogging [[-Objects] <Object[]>] [-Timeout <int>] [<CommonParameters>]

Description

Set-XpLogging saves the transferred LogLevel objects in the XPhone Connect Server.

All changes to the object are transferred to the XPhone Connect Server immediately and without further inquiry and stored there.

Warning

The changes can then no longer be reversed, so a thorough review of the changed data is essential.

Parameter

  • -Objects <LogLevel[]>
    • Specifies the logger objects to be stored on the XPhone Connect Server.

  • -Timeout <int>
    • Timeout in minutes.

    • If a command takes too long (e.g. due to too many data records or similar), this command can be aborted with this parameter after the specified time.

  • <CommonParameters>

Inputs

The input type is the type of objects that can be passed to Set-XpLogging via pipelining:

  • LogLevel

Outputs

The Set-XpLogging command does not return any objects.

Example

  1. Sets the log level for all loggers that are currently set to Debug to Off, which deactivates logging for these loggers:

    Get-XpLogging | Where-Object {$_.Level -eq "Debug"} | foreach{$_.Level = "Off";$_} | Set-XpLogging
    

    Explanation of the pipeline:

    1. The first step fetches all loggers from the XPhone Connect Server (Get-XpLogging).

    2. It then filters for loggers that are set to Debug (Where-Object {$_.Level -eq "Debug"}).

    3. All loggers found are then switched off (foreach{$_.Level = "Off";$_}).

    4. Finally, the changes are transferred to the XPhone Connect Server and saved (Set-XpLogging).

  2. Switch on logging for all SIP gateways (level DebugHigh):

    Get-XpLogging -GatewayType SIP | foreach{$_.Level = "DebugHigh";$_} | Set-XpLogging
    

    Explanation of the pipeline:

    1. The first step fetches all SIP gateway loggers from the XPhone Connect Server (Get-XpLogging -GatewayType SIP).

    2. The Debug level is then set for all those Loggers that remain after filtering (foreach{$_.Level = "DebugHigh";$_}).

    3. Finally, the changes are transferred to the XPhone Connect Server and saved (Set-XpLogging).

Have you found a mistake on this page?

Or is something not formulated well or too vague? Then we look forward to receiving an e-mail, preferably with a suggestion for improvement, to doku@c4b.de. Thank you very much!