From 939fd01e8641c2cf6142b03a92e4b6f62e25684b Mon Sep 17 00:00:00 2001 From: Pravin Pushkar Date: Wed, 31 May 2023 10:09:10 +0530 Subject: [PATCH] Added newly added flags for multi app run (#3461) * Added newly added flags for multi app run Signed-off-by: Pravin Pushkar * AdUpdate overview Signed-off-by: Pravin Pushkar * Update daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md Signed-off-by: Mark Fussell * Update daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md Signed-off-by: Mark Fussell * Update daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md Signed-off-by: Mark Fussell --------- Signed-off-by: Pravin Pushkar Signed-off-by: Mark Fussell Co-authored-by: Mark Fussell --- .../multi-app-dapr-run/multi-app-overview.md | 9 +++++++++ .../multi-app-dapr-run/multi-app-template.md | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 748200d01..5fac41131 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -67,6 +67,14 @@ You can also name each app directory's `.dapr` directory something other than `. ## Logs +The run template provides two log destination fields for each application and its associated daprd process: + +1. `appLogDestination` : This field configures the log destination for the application. The possible values are `console`, `file` and `fileAndConsole`. The default value is `fileAndConsole` where application logs are written to both console and to a file by default. + +2. `daprdLogDestination` : This field configures the log destination for the `daprd` process. The possible values are `console`, `file` and `fileAndConsole`. The default value is `file` where the `daprd` logs are written to a file by default. + +#### Log file format + Logs for application and `daprd` are captured in separate files. These log files are created automatically under `.dapr/logs` directory under each application directory (`appDirPath` in the template). These log file names follow the pattern seen below: - `_app_.log` (file name format for `app` log) @@ -74,6 +82,7 @@ Logs for application and `daprd` are captured in separate files. These log files Even if you've decided to rename your resources folder to something other than `.dapr`, the log files are written only to the `.dapr/logs` folder (created in the application directory). + ## Watch the demo Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 98a499b09..e3b762925 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -76,12 +76,15 @@ common: # optional section for variables shared across apps apps: - appID: webapp # optional appDirPath: .dapr/webapp/ # REQUIRED - resourcesPath: .dapr/resources # (optional) can be default by convention + resourcesPath: .dapr/resources # deprecated + resourcesPaths: .dapr/resources # comman separated resources paths. (optional) can be default by convention configFilePath: .dapr/config.yaml # (optional) can be default by convention too, ignore if file is not found. appProtocol: http appPort: 8080 appHealthCheckPath: "/healthz" command: ["python3" "app.py"] + appLogDestination: file # (optional), can be file, console or fileAndConsole. default is fileAndConsole. + daprdLogDestination: file # (optional), can be file, console or fileAndConsole. default is file. - appID: backend # optional appDirPath: .dapr/backend/ # REQUIRED appProtocol: grpc @@ -110,7 +113,8 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag |--------------------------|:--------:|--------|---------| | `appDirPath` | Y | Path to the your application code | `./webapp/`, `./backend/` | | `appID` | N | Application's app ID. If not provided, will be derived from `appDirPath` | `webapp`, `backend` | -| `resourcesPath` | N | Path to your Dapr resources. Can be default by convention; ignore if directory isn't found | `./app/components`, `./webapp/components` | +| `resourcesPath` | N | **Deprecated**. Path to your Dapr resources. Can be default by convention| `./app/components`, `./webapp/components` | +| `resourcesPaths` | N | Comma separated paths to your Dapr resources. Can be default by convention | `./app/components`, `./webapp/components` | | `configFilePath` | N | Path to your application's configuration file | `./webapp/config.yaml` | | `appProtocol` | N | The protocol Dapr uses to talk to the application. | `http`, `grpc` | | `appPort` | N | The port your application is listening on | `8080`, `3000` | @@ -137,6 +141,8 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag | `enableApiLogging` | N | Enable the logging of all API calls from application to Dapr | | | `runtimePath` | N | Dapr runtime install path | | | `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` | +| `appLogDestination` | N | Log destination for outputting app logs; Its value can be file, console or fileAndConsole. Default is fileAndConsole | `file`, `console`, `fileAndConsole` | +| `daprdLogDestination` | N | Log destination for outputting daprd logs; Its value can be file, console or fileAndConsole. Default is file | `file`, `console`, `fileAndConsole` | ## Next steps