# LogProperty

The `AWS::ApplicationInsights::Application Log` property type specifies a log to monitor for the component.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_applicationinsights as applicationinsights } from 'aws-cdk-lib';
const logProperty: applicationinsights.CfnApplication.LogProperty = {
  logType: 'logType',

  // the properties below are optional
  encoding: 'encoding',
  logGroupName: 'logGroupName',
  logPath: 'logPath',
  patternSet: 'patternSet',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_applicationinsights as applicationinsights

log_property = applicationinsights.CfnApplication.LogProperty(
    log_type="logType",

    # the properties below are optional
    encoding="encoding",
    log_group_name="logGroupName",
    log_path="logPath",
    pattern_set="patternSet"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.applicationinsights.*;

LogProperty logProperty = LogProperty.builder()
        .logType("logType")

        // the properties below are optional
        .encoding("encoding")
        .logGroupName("logGroupName")
        .logPath("logPath")
        .patternSet("patternSet")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ApplicationInsights;

var logProperty = new LogProperty {
    LogType = "logType",

    // the properties below are optional
    Encoding = "encoding",
    LogGroupName = "logGroupName",
    LogPath = "logPath",
    PatternSet = "patternSet"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

logProperty := &LogProperty{
	LogType: jsii.String("logType"),

	// the properties below are optional
	Encoding: jsii.String("encoding"),
	LogGroupName: jsii.String("logGroupName"),
	LogPath: jsii.String("logPath"),
	PatternSet: jsii.String("patternSet"),
}
```

## Properties

- `encoding`: string — The type of encoding of the logs to be monitored.

  The specified encoding should be included in the list of CloudWatch agent supported encodings. If not provided, CloudWatch Application Insights uses the default encoding type for the log type:

  - `APPLICATION/DEFAULT` : utf-8 encoding
  - `SQL_SERVER` : utf-16 encoding
  - `IIS` : ascii encoding

- `logGroupName`: string — The CloudWatch log group name to be associated with the monitored log.

- `logPath`: string — The path of the logs to be monitored.

  The log path must be an absolute Windows or Linux system file path. For more information, see [CloudWatch Agent Configuration File: Logs Section](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Logssection) .

- `logType`: string (required) — The log type decides the log patterns against which Application Insights analyzes the log.

  The log type is selected from the following: `SQL_SERVER` , `MYSQL` , `MYSQL_SLOW_QUERY` , `POSTGRESQL` , `ORACLE_ALERT` , `ORACLE_LISTENER` , `IIS` , `APPLICATION` , `WINDOWS_EVENTS` , `WINDOWS_EVENTS_ACTIVE_DIRECTORY` , `WINDOWS_EVENTS_DNS` , `WINDOWS_EVENTS_IIS` , `WINDOWS_EVENTS_SHAREPOINT` , `SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP` , `SQL_SERVER_FAILOVER_CLUSTER_INSTANCE` , `STEP_FUNCTION` , `API_GATEWAY_ACCESS` , `API_GATEWAY_EXECUTION` , `SAP_HANA_LOGS` , `SAP_HANA_TRACE` , `SAP_HANA_HIGH_AVAILABILITY` , and `DEFAULT` .

- `patternSet`: string — The log pattern set.
