You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deployments/configuration.md
+75-3Lines changed: 75 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -533,7 +533,7 @@ localStudio:
533
533
534
534
### `logging`
535
535
536
-
The `logging` section configures Harper logging across all Harper functionality. This includes standard text logging of application and database events as well as structured data logs of record changes. Logging of application/database events are logged in text format to the `~/hdb/log/hdb.log` file (or location specified by `logging.root`).
536
+
The `logging` section configures Harper logging across all Harper functionality. This includes standard text logging of application and database events as well as structured data logs of record changes. Logging of application/database events are logged in text format to the `~/hdb/log/hdb.log` file (or location specified by `logging.root` or `logging.path`). Many of the logging configuration properties can be set and applied without a restart (are dynamically applied).
537
537
538
538
In addition, structured logging of data changes are also available:
539
539
@@ -582,7 +582,7 @@ There exists a log level hierarchy in order as `trace`, `debug`, `info`, `warn`,
582
582
583
583
`console` - _Type_: boolean; _Default_: true
584
584
585
-
Controls whether console.log and other console.\* calls (as well as another JS components that writes to `process.stdout` and `process.stderr`) are logged to the log file. By default, these are logged to the log file, but this can be disabled.
585
+
Controls whether console.log and other console.\* calls (as well as another JS components that writes to `process.stdout` and `process.stderr`) are logged to the log file. By default, these are not logged to the log file, but this can be enabled:
Rotation provides the ability for a user to systematically rotate and archive the `hdb.log` file. To enable `interval` and/or `maxSize` must be set.
@@ -664,6 +673,69 @@ logging:
664
673
logSuccessful: false
665
674
```
666
675
676
+
## Defining Separate Logging Configurations
677
+
678
+
Harper's logger supports defining multiple logging configurations for different components in the system. Each logging configuration can be assigned its own `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`. All logging defaults to the configuration of the "main" logger as configured above, but when logging is configured for different loggers, they will use their own configuration. Separate loggers can be defined:
679
+
680
+
`logging.external`
681
+
682
+
The `logging.external` section can be used to define logging for all external components that use the [`logger` API](../technical-details/reference/globals.md). For example:
683
+
```yaml
684
+
logging:
685
+
external:
686
+
level: warn
687
+
path: ~/hdb/log/apps.log
688
+
```
689
+
690
+
`http.logging`
691
+
692
+
This section defines log configuration for HTTP logging. By default, HTTP requests are not logged, but defining this section will enable HTTP logging. Note that there can be substantive overhead to logging all HTTP requests. In addition to the standard logging configuration, the `http.logging` section also allows the following configuration properties to be set:
693
+
* `timing` - This will log timing information
694
+
* `headers` - This will log the headers in each request (which can be very verbose)
695
+
* `id` - This will assign a unique id to each request and log it in the entry for each request. This is assigned as the `request.requestId` property and can be used to by other logging to track a request.
696
+
Note that the `level` will determine which HTTP requests are logged:
697
+
* `info` (or more verbose) - All HTTP requests
698
+
* `warn` - HTTP requests with a status code of 400 or above
699
+
* `error` - HTTP requests with a status code of 500
700
+
701
+
For example:
702
+
```yaml
703
+
http:
704
+
logging:
705
+
timing: true
706
+
level: info
707
+
path: ~/hdb/log/http.log
708
+
... rest of http config
709
+
```
710
+
711
+
`authentication.logging`
712
+
713
+
This section defines log configuration for authentication. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
714
+
715
+
`mqtt.logging`
716
+
717
+
This section defines log configuration for MQTT. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
718
+
719
+
`replication.logging`
720
+
721
+
This section defines log configuration for replication. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
722
+
723
+
`tls.logging`
724
+
725
+
This section defines log configuration for TLS. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
726
+
727
+
`storage.logging`
728
+
729
+
This section defines log configuration for setting up and reading the database files. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
730
+
731
+
`storage.logging`
732
+
733
+
This section defines log configuration for setting up and reading the database files. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
734
+
735
+
`analytics.logging`
736
+
737
+
This section defines log configuration for analytics. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
0 commit comments