Skip to content

Commit

Permalink
docs: faq add where are my logs (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored and atian25 committed Mar 29, 2017
1 parent b8fc4e4 commit 92ef92b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions docs/source/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ If you have questions that is not contained below, please check [Egg issues](htt

Framework [Config](./basics/config.md) settings is powerfull, support different environments and different places(framework, plugins, app).

When you got some trouble, and want to find out what is the final config using at runtime, you can checkout `run/application_config.json` and `run/agent_config.json`.
When you got some trouble, and want to find out what is the final config using at runtime, you can checkout `${root}/run/application_config.json`(workers' configurations) and `${root}/run/agent_config.json`(agent's configurations).(`root` is application's root directory, in `local` and `unittest` environments, it will be project base directory, in other environments will be HOME directory)

## Where are my log files in prod environment?

By default, logs will print at `${baseDir}/logs`(baseDir is project's base directory) in local environment.But in non-development environments(neither local nor unittest), the logs will print at `$HOME/logs`(such as `/home/admin/logs`). So the logs won't mix in during development and locate in the same place when run in production environment.

## Why not choose PM2 as process management tool?

Expand Down Expand Up @@ -60,4 +64,3 @@ According to Jetbrains [Safe Write document](https://www.jetbrains.com/help/webs
> If this check box is selected, a changed file is first saved in a temporary file. If the save operation succeeds, the file being saved is replaced with the saved file. (Technically, the original file is deleted and the temporary file is renamed.)
Renaming files leads to file watching failure. The solution is simple: just turn of `Safe Write` option. (Settings | Appearance & Behavior | System Settings | Use "safe write", the path may vary in different versions)

8 changes: 6 additions & 2 deletions docs/source/zh-cn/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ title: 常见问题

## 为什么我的配置不生效?

框架的配置功能比较强大,有不同环境变量,又有框架/插件/应用等很多地方配置。
框架的配置功能比较强大,有不同环境变量,又有框架、插件、应用等很多地方配置。

如果你分析问题时,想知道当前运行时使用的最终配置,可以查看下 `run/application_config.json` `run/agent_config.json` 这两个文件。
如果你分析问题时,想知道当前运行时使用的最终配置,可以查看下 `${root}/run/application_config.json`(worker 进程配置) `${root}/run/agent_config.json`(agent 进程配置) 这两个文件。`root` 为应用根目录,只有在 local 和 unittest 环境下为项目所在目录,其他环境下都为 HOME 目录)

也可参见[配置文件](https://eggjs.org/zh-cn/basics/config.html#配置结果)

## 线上的日志打印去哪里了?

默认配置下,本地开发环境的日志都会打印在应用根目录的 `logs` 文件夹下(`${baseDir}/logs`) ,但是在非开发期的环境(非 local 和 unittest 环境),所有的日志都会打印到 `$HOME/logs` 文件夹下(例如 `/home/admin/logs`)。这样可以让本地开发时应用日志互不影响,服务器运行时又有统一的日志输出目录。

## 进程管理为什么没有选型 PM2 ?

1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。
Expand Down

0 comments on commit 92ef92b

Please sign in to comment.