Skip to content

Commit eccc63b

Browse files
author
Phil Varner
authored
Merge pull request #368 from stac-utils/pv/refactor-logging-to-use-winston
refactor logging to use winston, so log levels will actually work
2 parents 6ec1947 + 2227022 commit eccc63b

26 files changed

+450
-108
lines changed

.eslintrc.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,14 @@
9191
"class-methods-use-this": "off",
9292
"no-return-await": "off",
9393
"no-warning-comments": "off",
94-
"no-unused-vars": [
95-
"error",
94+
// note you must disable the base rule as it can report incorrect errors
95+
"no-unused-vars": "off",
96+
"@typescript-eslint/no-unused-vars": [
97+
"warn", // or "error"
9698
{
97-
"argsIgnorePattern": "^_"
99+
"argsIgnorePattern": "^_",
100+
"varsIgnorePattern": "^_",
101+
"caughtErrorsIgnorePattern": "^_"
98102
}
99103
],
100104
"no-useless-escape": "off",

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased - TBD
99

10+
### Fixed
11+
12+
- Log level configuration now has an effect on log levels
13+
1014
### Changed
1115

12-
- Search query and response body is now logged at level DEBUG rather than INFO
13-
- Ingested item body is now logged at level DEBUG rather than INFO
16+
- Log level must be configured with lowercase values error, warn, info, http, verbose, debug, silly instead of uppercase values (this config had no effect before)
17+
- Default request logging format is now "tiny" instead of "dev". Previously, the "dev" format
18+
wrote color codes into CloudWatch logs, which cluttered output, as they were not used in display.
19+
- Search query and response body is now logged at level "debug" rather than "info"
20+
- Ingested item body is now logged at level "debug" rather than "info"
1421

1522
## [0.5.2] - 2023-01-17
1623

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ There are some settings that should be reviewed and updated as needeed in the se
403403
| STAC_DESCRIPTION | Description of this catalog | A STAC API |
404404
| STAC_DOCS_URL | URL to documentation | [https://stac-utils.github.io/stac-server](https://stac-utils.github.io/stac-server) |
405405
| INGEST_BATCH_SIZE | Number of records to ingest in single batch | 500 |
406-
| LOG_LEVEL | Level for logging (CRITICAL, ERROR, WARN, INFO, DEBUG) | INFO |
406+
| LOG_LEVEL | Level for logging (error, warn, info, http, verbose, debug, silly) | INFO |
407+
| REQUEST_LOGGING_ENABLED | Express request logging enabled. String 'false' disables. | enabled |
408+
| REQUEST_LOGGING_FORMAT | Express request logging format to use. Any of the [Morgan predefined formats](https://github.com/expressjs/morgan#predefined-formats). | tiny |
407409
| STAC_API_URL | The root endpoint of this API | Inferred from request |
408410
| ENABLE_TRANSACTIONS_EXTENSION | Boolean specifying if the [Transaction Extension](https://github.com/radiantearth/stac-api-spec/tree/master/ogcapi-features/extensions/transaction) should be activated | false |
409411
| STAC_API_ROOTPATH | The path to append to URLs if this is not deployed at the server root. For example, if the server is deployed without a custom domain name, it will have the stage name (e.g., dev) in the path. | "" |

bin/system-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TEST_PATTERN=${1:-test-*.[jt]s}
77
export AWS_ACCESS_KEY_ID='none'
88
export AWS_SECRET_ACCESS_KEY='none'
99
export ENABLE_TRANSACTIONS_EXTENSION=true
10+
export REQUEST_LOGGING_ENABLED=false
1011

1112
echo "Running tests"
1213
set +e

0 commit comments

Comments
 (0)