# Configuring Access Logs for Response Time Monitoring
A high-performing application delivers an exceptional user experience. To proactively detect and resolve latency issues, our yCrash 360 script can ingest and analyze access logs from your applications, providing deep visibility into request-response times and automatically capturing incidents when anomalies are detected.
This document explains how to configure access log ingestion using the yc-config.yaml file for single or multiple applications to fully leverage yCrash 360’s monitoring capabilities.
# Prerequisites
Ensure the following prerequisites are met before configuring access logs:
- You have access to the yc-config.yaml configuration file.
- You should enable the access logs with response time (i.e, %D) for the target application that you want to monitor using M3. To enable the response time, add
%Din your access log formats.
# Configuration for a Single Application
The steps below will help you to configure the access logs for a single application:
Steps:
- Open the
yc-config.yamlfile in a text editor. - Under the
Options: Block section, you need to add the two specific properties, i.e, "accessLogs:" and "accessLogFormats:" - accessLogs: Under this property, specify the location of the access log filepath of the target application, which you want to monitor, along with the appname separated with '$'. The app name should be the same as you configured under the processTokens. Suppose the access log is at location "apt/logs/accessLog.txt", and the appname you configured under the processTokens is "App1", then you need to configure this property as below:
accessLogs:
- apt/logs/accessLog.txt$App1
2
- accessLogSources: Under this property, specify the source of the access log. Let’s say if your application server is Apache, and it is the source of the access log, then you need to specify its source name, along with the app name, separated by a '$'. The app name should be the same as you configured under 'processTokens'. Suppose appname you configured under the processTokens is "App1", then you need to configure this property as below:
accessLogSources:
- Apache$App1
2
- accessLogFormats: Under this property, specify the format of the target application’s access log along with the appname separated with the $. Suppose the format of the access Log is "
%h %l %u %t %r %s %b %D", and the appname you configured under the processTokens is "App1", then you need to configure this property as below:
accessLogFormats:
- "%h %l %u %t %r %s %b %D$App1"
2
Note: You should enable the response time property in your access logs format.
Below is the sample configuration of the YAML file for a single application:
Sample Configuration:
version: '1'
options:
k: {API_KEY}
s: {http://MY-YC-SERVER:PORT}
j: {JAVA_HOME}
accessLogs:
- D:\ycrash-workstation\logs\access.log$App1
accessLogSources:
- Apache$App1
accessLogFormats:
- "%h %l %u %t %r %s %b %D$App1"
processTokens:
- uniqueKey$App1
2
3
4
5
6
7
8
9
10
11
12
13
# Configuration for Multiple Applications
If you are monitoring more than one application, configure each access log and format with a corresponding application identifier.
Steps:
Open the
yc-config.yamlfile in a text editor.Under
accessLogs, list each access log path with the app name suffix as discussed above. Let’s say if you are monitoring the 2 applications, then specify the accessLog locations like the format below:
accessLogs:
- apt/logs/accessLog1.txt$App1
- apt/logs/accessLog2.txt$App2
2
3
- Under
accessLogSources, provide the source for each application's access logs as discussed above with appname suffix. Let’s say if you are monitoring the 2 applications, then specify the accessLog sources like the below:
accessLogSources:
- Apache$App1
- Tomcat$App2
2
3
- Under
accessLogFormats, provide the format string for each application’s access logs as discussed above with appname suffix. Let’s say if you are monitoring the 2 applications, then specify the accessLog formats like the below:
accessLogFormats:
- "%h %l %u %t %r %s %b %D$App1"
- "%h %l %u %t %r %s %b %D$App2"
2
3
- Under processTokens:, map each application's process identifier to the corresponding suffix.
Sample Configuration:
version: '1'
options:
k: {API_KEY}
s: {http://MY-YC-SERVER:PORT}
j: {JAVA_HOME}
accessLogs:
- apt/logs/accessLog1.txt$App1
- apt/logs/accessLog2.txt$App2
accessLogSources:
- Apache$App1
- Tomcat$App2
accessLogFormats:
- "%h %l %u %t %r %s %b %D$App1"
- "%h %l %u %t %r %s %b %D$App2"
processTokens:
- buggyApp.jar$App1
- webapp-runner$App2
a: {APP_NAME}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Notes: Ensure the suffixes of appnames used in accessLogs,accessLogSources, accessLogFormats, and processTokens are consistent.