Skip to content

Commit cd41ac3

Browse files
committed
More information on logging
1 parent b338ce8 commit cd41ac3

File tree

1 file changed

+75
-3
lines changed

1 file changed

+75
-3
lines changed

docs/deployments/configuration.md

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ localStudio:
533533

534534
### `logging`
535535

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).
537537

538538
In addition, structured logging of data changes are also available:
539539

@@ -582,7 +582,7 @@ There exists a log level hierarchy in order as `trace`, `debug`, `info`, `warn`,
582582

583583
`console` - _Type_: boolean; _Default_: true
584584

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:
586586

587587
```yaml
588588
logging:
@@ -591,13 +591,22 @@ logging:
591591

592592
`root` - _Type_: string; _Default_: \<ROOTPATH>/log
593593

594-
The path where the log files will be written.
594+
The directory path where the log files will be written.
595595

596596
```yaml
597597
logging:
598598
root: ~/hdb/log
599599
```
600600

601+
`path` - _Type_: string; _Default_: \<ROOTPATH>/log/hdb.log
602+
603+
The file path where the log file will be written.
604+
605+
```yaml
606+
logging:
607+
root: ~/hdb/log/hdb.log
608+
```
609+
601610
`rotation`
602611

603612
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:
664673
logSuccessful: false
665674
```
666675

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`.
738+
667739
***
668740

669741
### `authentication`

0 commit comments

Comments
 (0)