# 로그 사용 가이드

## 소개

* 커스터마이징 시 사용자 로그 채널을 이용하여 로그를 남기면 확인이 가능합니다.
* 아래 가이드를 따라 확인 및 개발을 진행해주세요.

***

## 로그 추가 방법

* 커스터마이징 시 데이터 확인 등이 필요할 때 원하는 위치에 아래 소스를 참고하여 로그를 추가합니다.

#### 로그 추가 예시

{% code overflow="wrap" %}

```
\Logger::channel('userLog')->debug(__METHOD__ . '[' . __LINE__ . '], ' . ' USER LOG : ', ['로그'=>'테스트']);
```

{% endcode %}

#### 로그 내용 확인

{% code overflow="wrap" %}

```
[2024-04-08 11:55:34] : Bundle\Controller\Admin\Goods\GoodsListController::index[39],  USER LOG :  {"로그":"테스트"} {"process_id":27076}
```

{% endcode %}

* 채널 : userLog
* 레벨 : debug
* 최대 생성 파일 개수 : 7개
* 경로 : /data/custom\_log/custom\_log-yyyy-mm-dd.log
* 압축 : 하루 지난 로그 파일은 zip 파일 압축 됩니다. (암호 x)

{% hint style="warning" %}
**해당 채널 및 레벨 외에는 로그가 남지 않아 확인이 불가합니다.**
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devcenter-help.nhn-commerce.com/other-guide/log.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
