# 26.3 파일 출력

기본적으로 Spring Boot는 콘솔에만 로그를 남기고 로그 파일을 작성하지 않습니다. 콘솔 출력 외에 로그 파일을 쓰고 싶다면 `logging.file`또는 `logging.path`속성 을 설정해야 합니다 (예 : 사용자 `application.properties`).

다음 표에서는 `logging.*`속성을 함께 사용할 수있는 방법을 보여줍니다 .

**표 26.1. 로깅 속성**

| `logging.file` | `logging.path` | 예          | 기술                                                            |
| -------------- | -------------- | ---------- | ------------------------------------------------------------- |
| *(none)*       | *(none)*       |            | 콘솔 전용 로깅.                                                     |
| 특정 파일          | *(none)*       | `my.log`   | 지정된 로그 파일에 기록합니다. 이름은 정확한 위치 또는 현재 디렉토리와 관련 될 수 있습니다.         |
| *(none)*       | 특정 디렉토리        | `/var/log` | `spring.log`지정된 디렉토리에 기록. 이름은 정확한 위치 또는 현재 디렉토리와 관련 될 수 있습니다. |

로그 파일은 10MB에 도달하면 회전하고 콘솔 출력처럼 `ERROR`-level, `WARN`-level 및 `INFO`-level 메시지가 기본적으로 기록됩니다. 크기 제한은 `logging.file.max-size`속성을 사용하여 변경할 수 있습니다 . 이전에 회전 된 파일은 `logging.file.max-history`속성이 설정되어 있지 않으면 무기한 보관됩니다 .

| ![\[Note\]](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/images/note.png) |
| ------------------------------------------------------------------------------------------------- |
| 로깅 시스템은 응용 프로그램 수명주기 초기에 초기화됩니다. 따라서 `@PropertySource` 주석을 통해로드 된 속성 파일에는 로깅 속성이 없습니다 .           |

| ![\[Tip\]](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/images/tip.png)                   |
| ----------------------------------------------------------------------------------------------------------------- |
| 로깅 속성은 실제 로깅 인프라와는 독립적입니다. **결과적으로 특정 구성 키 (예 : `logback.configurationFile`Logback)는 Spring Boot에 의해 관리되지 않습니다.** |


---

# 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://wannaqueen.gitbook.io/spring5/spring-boot/undefined-1/26.-by-ks/26.3.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.
