1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

chore: change log level to info in origin middleware (#7705)

https://linear.app/unleash/issue/2-2492/change-origin-middleware-log-level-to-info

Changes origin middleware log level to `info` instead of `debug`.
This commit is contained in:
Nuno Góis 2024-07-31 09:01:48 +01:00 committed by GitHub
parent 2822746fc1
commit 9fff29a080
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ describe('originMiddleware', () => {
middleware(req, res, next);
expect(loggerMock.debug).toHaveBeenCalledWith('UI request', {
expect(loggerMock.info).toHaveBeenCalledWith('UI request', {
method: req.method,
});
});
@ -58,7 +58,7 @@ describe('originMiddleware', () => {
middleware(req, res, next);
expect(loggerMock.debug).toHaveBeenCalledWith('API request', {
expect(loggerMock.info).toHaveBeenCalledWith('API request', {
method: req.method,
userAgent: TEST_USER_AGENT,
});

View File

@ -16,9 +16,9 @@ export const originMiddleware = ({
const isUI = !req.headers.authorization;
if (isUI) {
logger.debug('UI request', { method: req.method });
logger.info('UI request', { method: req.method });
} else {
logger.debug('API request', {
logger.info('API request', {
method: req.method,
userAgent: req.headers['user-agent'],
});