mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
config.logs throw an error, logging config not longer accept array or… (#3097)
This commit is contained in:
parent
4088cdef6d
commit
82cb0f2bff
45
.changeset/proud-jobs-hope.md
Normal file
45
.changeset/proud-jobs-hope.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
'@verdaccio/api': major
|
||||||
|
'@verdaccio/cli': major
|
||||||
|
'@verdaccio/config': major
|
||||||
|
'@verdaccio/core': major
|
||||||
|
'@verdaccio/types': major
|
||||||
|
'@verdaccio/logger': major
|
||||||
|
'@verdaccio/node-api': major
|
||||||
|
'verdaccio-aws-s3-storage': major
|
||||||
|
'verdaccio-google-cloud': major
|
||||||
|
'verdaccio-htpasswd': major
|
||||||
|
'@verdaccio/local-storage': major
|
||||||
|
'verdaccio-memory': major
|
||||||
|
'@verdaccio/ui-theme': major
|
||||||
|
'@verdaccio/proxy': major
|
||||||
|
'@verdaccio/server': major
|
||||||
|
'@verdaccio/mock': major
|
||||||
|
'verdaccio': major
|
||||||
|
'@verdaccio/web': major
|
||||||
|
'@verdaccio/e2e-cli': major
|
||||||
|
'@verdaccio/website': major
|
||||||
|
---
|
||||||
|
|
||||||
|
feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||||
|
|
||||||
|
### 💥 Breaking change
|
||||||
|
|
||||||
|
This is valid
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
log: { type: stdout, format: pretty, level: http }
|
||||||
|
```
|
||||||
|
|
||||||
|
This is invalid
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
logs: { type: stdout, format: pretty, level: http }
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
logs:
|
||||||
|
- [{ type: stdout, format: pretty, level: http }]
|
||||||
|
```
|
@ -46,4 +46,4 @@ middlewares:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
@ -42,4 +42,4 @@ middlewares:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
logs: { type: stdout, format: json, level: trace }
|
log: { type: stdout, format: json, level: trace }
|
||||||
|
@ -22,7 +22,8 @@ invalid address - xxxxxx, we expect a port (e.g. "4873"),
|
|||||||
|
|
||||||
## VERDEP002
|
## VERDEP002
|
||||||
|
|
||||||
'deprecate: multiple logger configuration is deprecated, please check the migration guide.'
|
> After version `verdaccio@6.0.0-6-next.38` this is not longer a warning and
|
||||||
|
> will crash your application
|
||||||
|
|
||||||
## VERDEP003
|
## VERDEP003
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
"docker": "docker build -t verdaccio/verdaccio:local . --no-cache",
|
"docker": "docker build -t verdaccio/verdaccio:local . --no-cache",
|
||||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||||
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||||
"lint": "eslint --max-warnings 45 \"**/*.{js,jsx,ts,tsx}\"",
|
"lint": "eslint --max-warnings 46 \"**/*.{js,jsx,ts,tsx}\"",
|
||||||
"test": "pnpm recursive test --filter ./packages",
|
"test": "pnpm recursive test --filter ./packages",
|
||||||
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-cli",
|
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-cli",
|
||||||
"test:e2e:ui": "pnpm test --filter ...@verdaccio/e2e-ui",
|
"test:e2e:ui": "pnpm test --filter ...@verdaccio/e2e-ui",
|
||||||
|
@ -18,7 +18,7 @@ publish:
|
|||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -11,7 +11,7 @@ web:
|
|||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -18,7 +18,7 @@ publish:
|
|||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -17,7 +17,7 @@ uplinks:
|
|||||||
npmjs:
|
npmjs:
|
||||||
url: https://registry.npmjs.org/
|
url: https://registry.npmjs.org/
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -17,7 +17,7 @@ uplinks:
|
|||||||
npmjs:
|
npmjs:
|
||||||
url: https://registry.npmjs.org/
|
url: https://registry.npmjs.org/
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Command, Option } from 'clipanion';
|
import { Command, Option } from 'clipanion';
|
||||||
|
|
||||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||||
import { warningUtils } from '@verdaccio/core';
|
|
||||||
import server from '@verdaccio/fastify-migration';
|
import server from '@verdaccio/fastify-migration';
|
||||||
import { logger, setup } from '@verdaccio/logger';
|
import { logger, setup } from '@verdaccio/logger';
|
||||||
import { ConfigRuntime } from '@verdaccio/types';
|
import { ConfigRuntime } from '@verdaccio/types';
|
||||||
@ -28,13 +27,13 @@ export class FastifyServer extends Command {
|
|||||||
|
|
||||||
private initLogger(logConfig: ConfigRuntime) {
|
private initLogger(logConfig: ConfigRuntime) {
|
||||||
try {
|
try {
|
||||||
if (logConfig.logs) {
|
if (logConfig.log) {
|
||||||
warningUtils.emit(warningUtils.Codes.VERDEP001);
|
throw Error('logger as array not longer supported');
|
||||||
}
|
}
|
||||||
// FUTURE: remove fallback when is ready
|
// FUTURE: remove fallback when is ready
|
||||||
setup(logConfig.log || logConfig.logs);
|
setup(logConfig.log);
|
||||||
} catch {
|
} catch (err: any) {
|
||||||
throw new Error('error on init logger');
|
throw new Error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Command, Option } from 'clipanion';
|
import { Command, Option } from 'clipanion';
|
||||||
|
|
||||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||||
import { warningUtils } from '@verdaccio/core';
|
|
||||||
import { logger, setup } from '@verdaccio/logger';
|
import { logger, setup } from '@verdaccio/logger';
|
||||||
|
import { LoggerConfigItem } from '@verdaccio/logger/src/logger';
|
||||||
import { initServer } from '@verdaccio/node-api';
|
import { initServer } from '@verdaccio/node-api';
|
||||||
import { ConfigRuntime } from '@verdaccio/types';
|
import { ConfigRuntime } from '@verdaccio/types';
|
||||||
|
|
||||||
@ -47,13 +47,13 @@ export class InitCommand extends Command {
|
|||||||
|
|
||||||
private initLogger(logConfig: ConfigRuntime) {
|
private initLogger(logConfig: ConfigRuntime) {
|
||||||
try {
|
try {
|
||||||
|
// @ts-expect-error
|
||||||
if (logConfig.logs) {
|
if (logConfig.logs) {
|
||||||
warningUtils.emit(warningUtils.Codes.VERDEP001);
|
throw Error('logger as array not longer supported');
|
||||||
}
|
}
|
||||||
// FUTURE: remove fallback when is ready
|
setup(logConfig.log as LoggerConfigItem);
|
||||||
setup(logConfig.log || logConfig.logs);
|
} catch (err: any) {
|
||||||
} catch {
|
throw new Error(err);
|
||||||
throw new Error('error on init logger');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
storage: ./storage
|
storage: ./storage
|
||||||
# path to a directory with plugins to include
|
# path to a directory with plugins to include
|
||||||
plugins: ./plugins
|
plugins: ./plugins
|
||||||
# print logs
|
|
||||||
# logs: ./logs
|
|
||||||
|
|
||||||
web:
|
web:
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
@ -87,7 +85,7 @@ middlewares:
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# log settings
|
# log settings
|
||||||
logs:
|
log:
|
||||||
# Logger as STDOUT
|
# Logger as STDOUT
|
||||||
{ type: stdout, format: pretty, level: http }
|
{ type: stdout, format: pretty, level: http }
|
||||||
# Logger as STDOUT as JSON
|
# Logger as STDOUT as JSON
|
||||||
|
@ -72,7 +72,7 @@ middlewares:
|
|||||||
|
|
||||||
# log settings
|
# log settings
|
||||||
# log settings
|
# log settings
|
||||||
logs:
|
log:
|
||||||
# Logger as STDOUT
|
# Logger as STDOUT
|
||||||
{ type: stdout, format: pretty, level: http }
|
{ type: stdout, format: pretty, level: http }
|
||||||
# Logger as STDOUT as JSON
|
# Logger as STDOUT as JSON
|
||||||
|
@ -57,11 +57,11 @@ describe('check basic content parsed file', () => {
|
|||||||
expect(config.middlewares).toBeDefined();
|
expect(config.middlewares).toBeDefined();
|
||||||
expect(config.middlewares.audit).toBeDefined();
|
expect(config.middlewares.audit).toBeDefined();
|
||||||
expect(config.middlewares.audit.enabled).toBeTruthy();
|
expect(config.middlewares.audit.enabled).toBeTruthy();
|
||||||
// logs
|
// log
|
||||||
expect(config.logs).toBeDefined();
|
expect(config.log).toBeDefined();
|
||||||
expect(config.logs.type).toEqual('stdout');
|
expect(config.log.type).toEqual('stdout');
|
||||||
expect(config.logs.format).toEqual('pretty');
|
expect(config.log.format).toEqual('pretty');
|
||||||
expect(config.logs.level).toEqual('http');
|
expect(config.log.level).toEqual('http');
|
||||||
// must not be enabled by default
|
// must not be enabled by default
|
||||||
expect(config.notify).toBeUndefined();
|
expect(config.notify).toBeUndefined();
|
||||||
expect(config.store).toBeUndefined();
|
expect(config.store).toBeUndefined();
|
||||||
|
@ -11,5 +11,5 @@ module.exports = {
|
|||||||
vue: { access: '$authenticated', publish: '$authenticated', proxy: 'npmjs' },
|
vue: { access: '$authenticated', publish: '$authenticated', proxy: 'npmjs' },
|
||||||
'*': { access: '$all', publish: '$all', proxy: 'npmjs' },
|
'*': { access: '$all', publish: '$all', proxy: 'npmjs' },
|
||||||
},
|
},
|
||||||
logs: [{ type: 'stdout', format: 'pretty', level: 'warn' }],
|
log: { type: 'stdout', format: 'pretty', level: 'warn' },
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
storage: './storage_default_storage'
|
storage: './storage_default_storage'
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- type: stdout
|
|
||||||
format: pretty
|
|
||||||
level: warn
|
|
||||||
|
@ -9,8 +9,7 @@ export enum Codes {
|
|||||||
VERWAR002 = 'VERWAR002',
|
VERWAR002 = 'VERWAR002',
|
||||||
VERWAR003 = 'VERWAR003',
|
VERWAR003 = 'VERWAR003',
|
||||||
VERWAR004 = 'VERWAR004',
|
VERWAR004 = 'VERWAR004',
|
||||||
VERDEP001 = 'VERDEP001',
|
// deprecation warnings
|
||||||
VERDEP002 = 'VERDEP002',
|
|
||||||
VERDEP003 = 'VERDEP003',
|
VERDEP003 = 'VERDEP003',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,18 +35,6 @@ host:port (e.g. "localhost:4873") or full url '(e.g. "http://localhost:4873/")
|
|||||||
https://verdaccio.org/docs/en/configuration#listen-port`
|
https://verdaccio.org/docs/en/configuration#listen-port`
|
||||||
);
|
);
|
||||||
|
|
||||||
warningInstance.create(
|
|
||||||
verdaccioDeprecation,
|
|
||||||
Codes.VERDEP001,
|
|
||||||
'config.logs is deprecated, rename configuration to "config.log" in singular'
|
|
||||||
);
|
|
||||||
|
|
||||||
warningInstance.create(
|
|
||||||
verdaccioDeprecation,
|
|
||||||
Codes.VERDEP002,
|
|
||||||
'deprecate: multiple logger configuration is deprecated, please check the migration guide.'
|
|
||||||
);
|
|
||||||
|
|
||||||
warningInstance.create(
|
warningInstance.create(
|
||||||
verdaccioDeprecation,
|
verdaccioDeprecation,
|
||||||
Codes.VERDEP003,
|
Codes.VERDEP003,
|
||||||
|
9
packages/core/types/index.d.ts
vendored
9
packages/core/types/index.d.ts
vendored
@ -335,10 +335,6 @@ declare module '@verdaccio/types' {
|
|||||||
sync(): void;
|
sync(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LoggerConf {
|
|
||||||
[key: string]: LoggerConfItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ListenAddress {
|
interface ListenAddress {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
@ -420,9 +416,8 @@ declare module '@verdaccio/types' {
|
|||||||
storage?: string | void;
|
storage?: string | void;
|
||||||
packages: PackageList;
|
packages: PackageList;
|
||||||
uplinks: UpLinksConfList;
|
uplinks: UpLinksConfList;
|
||||||
// @deprecated in favor of log
|
// FUTURE: log should be mandatory
|
||||||
logs?: LoggerConf[];
|
log?: LoggerConfItem;
|
||||||
log?: LoggerConf[];
|
|
||||||
web?: WebConf;
|
web?: WebConf;
|
||||||
auth?: AuthConf;
|
auth?: AuthConf;
|
||||||
security: Security;
|
security: Security;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||||
"@verdaccio/logger-prettify": "workspace:6.0.0-6-next.6",
|
"@verdaccio/logger-prettify": "workspace:6.0.0-6-next.6",
|
||||||
|
"pino-pretty": "7.6.0",
|
||||||
"debug": "4.3.3",
|
"debug": "4.3.3",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"pino": "7.6.4"
|
"pino": "7.6.4"
|
||||||
|
@ -26,12 +26,12 @@ export type LogFormat = 'json' | 'pretty-timestamped' | 'pretty';
|
|||||||
export function createLogger(
|
export function createLogger(
|
||||||
options = { level: 'http' },
|
options = { level: 'http' },
|
||||||
destination = pino.destination(1),
|
destination = pino.destination(1),
|
||||||
format: LogFormat = DEFAULT_LOG_FORMAT,
|
|
||||||
prettyPrintOptions = {
|
prettyPrintOptions = {
|
||||||
// we hide warning since the prettifier should not be used in production
|
// we hide warning since the prettifier should not be used in production
|
||||||
// https://getpino.io/#/docs/pretty?id=prettifier-api
|
// https://getpino.io/#/docs/pretty?id=prettifier-api
|
||||||
suppressFlushSyncWarning: true,
|
suppressFlushSyncWarning: true,
|
||||||
}
|
},
|
||||||
|
format: LogFormat = DEFAULT_LOG_FORMAT
|
||||||
) {
|
) {
|
||||||
if (_.isNil(format)) {
|
if (_.isNil(format)) {
|
||||||
format = DEFAULT_LOG_FORMAT;
|
format = DEFAULT_LOG_FORMAT;
|
||||||
@ -116,19 +116,11 @@ export type LoggerConfigItem = {
|
|||||||
level?: string;
|
level?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LoggerConfig = LoggerConfigItem[];
|
export type LoggerConfig = LoggerConfigItem;
|
||||||
|
|
||||||
export function setup(options: LoggerConfig | LoggerConfigItem = DEFAULT_LOGGER_CONF) {
|
export function setup(options: LoggerConfigItem = DEFAULT_LOGGER_CONF) {
|
||||||
debug('setup logger');
|
debug('setup logger');
|
||||||
const isLegacyConf = Array.isArray(options);
|
let loggerConfig = options;
|
||||||
if (isLegacyConf) {
|
|
||||||
warningUtils.emit(warningUtils.Codes.VERDEP002);
|
|
||||||
}
|
|
||||||
|
|
||||||
// verdaccio 5 does not allow multiple logger configuration
|
|
||||||
// backward compatible, pick only the first option
|
|
||||||
// next major will thrown an error
|
|
||||||
let loggerConfig = isLegacyConf ? options[0] : options;
|
|
||||||
if (!loggerConfig?.level) {
|
if (!loggerConfig?.level) {
|
||||||
loggerConfig = Object.assign(
|
loggerConfig = Object.assign(
|
||||||
{},
|
{},
|
||||||
@ -143,13 +135,17 @@ export function setup(options: LoggerConfig | LoggerConfigItem = DEFAULT_LOGGER_
|
|||||||
debug('logging file enabled');
|
debug('logging file enabled');
|
||||||
const destination = pino.destination(loggerConfig.path);
|
const destination = pino.destination(loggerConfig.path);
|
||||||
process.on('SIGUSR2', () => destination.reopen());
|
process.on('SIGUSR2', () => destination.reopen());
|
||||||
|
// @ts-ignore
|
||||||
logger = createLogger(pinoConfig, destination, loggerConfig.format);
|
logger = createLogger(pinoConfig, destination, loggerConfig.format);
|
||||||
|
// @ts-ignore
|
||||||
} else if (loggerConfig.type === 'rotating-file') {
|
} else if (loggerConfig.type === 'rotating-file') {
|
||||||
warningUtils.emit(warningUtils.Codes.VERWAR003);
|
warningUtils.emit(warningUtils.Codes.VERWAR003);
|
||||||
debug('logging stdout enabled');
|
debug('logging stdout enabled');
|
||||||
|
// @ts-ignore
|
||||||
logger = createLogger(pinoConfig, pino.destination(1), loggerConfig.format);
|
logger = createLogger(pinoConfig, pino.destination(1), loggerConfig.format);
|
||||||
} else {
|
} else {
|
||||||
debug('logging stdout enabled');
|
debug('logging stdout enabled');
|
||||||
|
// @ts-ignore
|
||||||
logger = createLogger(pinoConfig, pino.destination(1), loggerConfig.format);
|
logger = createLogger(pinoConfig, pino.destination(1), loggerConfig.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { warningUtils } from '@verdaccio/core';
|
|
||||||
|
|
||||||
import { logger, setup } from '../src';
|
import { logger, setup } from '../src';
|
||||||
|
|
||||||
const mockWarningUtils = jest.fn();
|
const mockWarningUtils = jest.fn();
|
||||||
@ -34,7 +32,7 @@ describe('logger', () => {
|
|||||||
// expect(spyOn).toHaveBeenCalledTimes(2);
|
// expect(spyOn).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('throw deprecation warning if multiple loggers configured', () => {
|
test.skip('throw deprecation warning if multiple loggers configured', () => {
|
||||||
setup([
|
setup([
|
||||||
{
|
{
|
||||||
level: 'info',
|
level: 'info',
|
||||||
@ -43,7 +41,7 @@ describe('logger', () => {
|
|||||||
level: 'http',
|
level: 'http',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
expect(mockWarningUtils).toHaveBeenCalledWith(warningUtils.Codes.VERDEP002);
|
// expect(mockWarningUtils).toHaveBeenCalledWith(warningUtils.Codes.VERDEP002);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('regression: do not throw deprecation warning if no logger config is provided', () => {
|
test('regression: do not throw deprecation warning if no logger config is provided', () => {
|
||||||
|
@ -9,7 +9,8 @@ import url from 'url';
|
|||||||
|
|
||||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||||
import { API_ERROR } from '@verdaccio/core';
|
import { API_ERROR } from '@verdaccio/core';
|
||||||
import { logger, setup } from '@verdaccio/logger';
|
import { setup } from '@verdaccio/logger';
|
||||||
|
import { LoggerConfigItem } from '@verdaccio/logger/src/logger';
|
||||||
import server from '@verdaccio/server';
|
import server from '@verdaccio/server';
|
||||||
import { ConfigRuntime, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';
|
import { ConfigRuntime, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ export async function initServer(
|
|||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// FIXME: get only the first match, the multiple address will be removed
|
// FIXME: get only the first match, the multiple address will be removed
|
||||||
const [addr] = getListListenAddresses(port, config.listen);
|
const [addr] = getListListenAddresses(port, config.listen);
|
||||||
const logger = setup((config as ConfigRuntime).logs);
|
const logger = setup(config?.log as LoggerConfigItem);
|
||||||
displayExperimentsInfoBox(config.flags);
|
displayExperimentsInfoBox(config.flags);
|
||||||
const app = await server(config);
|
const app = await server(config);
|
||||||
const serverFactory = createServerFactory(config, addr, app);
|
const serverFactory = createServerFactory(config, addr, app);
|
||||||
@ -172,14 +173,14 @@ export async function runServer(config?: string | ConfigRuntime): Promise<any> {
|
|||||||
let configurationParsed: ConfigRuntime;
|
let configurationParsed: ConfigRuntime;
|
||||||
if (config === undefined || typeof config === 'string') {
|
if (config === undefined || typeof config === 'string') {
|
||||||
const configPathLocation = findConfigFile(config);
|
const configPathLocation = findConfigFile(config);
|
||||||
configurationParsed = parseConfigFile(configPathLocation);
|
configurationParsed = parseConfigFile(configPathLocation) as ConfigRuntime;
|
||||||
} else if (_.isObject(config)) {
|
} else if (_.isObject(config)) {
|
||||||
configurationParsed = config;
|
configurationParsed = config;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(API_ERROR.CONFIG_BAD_FORMAT);
|
throw new Error(API_ERROR.CONFIG_BAD_FORMAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(configurationParsed.logs);
|
setup(configurationParsed.log as LoggerConfigItem);
|
||||||
displayExperimentsInfoBox(configurationParsed.flags);
|
displayExperimentsInfoBox(configurationParsed.flags);
|
||||||
// FIXME: get only the first match, the multiple address will be removed
|
// FIXME: get only the first match, the multiple address will be removed
|
||||||
const [addr] = getListListenAddresses(undefined, configurationParsed.listen);
|
const [addr] = getListListenAddresses(undefined, configurationParsed.listen);
|
||||||
|
@ -31,13 +31,11 @@ export default class Config {
|
|||||||
proxy: [],
|
proxy: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
this.logs = [
|
this.log = {
|
||||||
{
|
|
||||||
type: 'stdout',
|
type: 'stdout',
|
||||||
format: 'pretty',
|
format: 'pretty',
|
||||||
level: 35,
|
level: 35,
|
||||||
},
|
};
|
||||||
];
|
|
||||||
this.config_path = './src/___tests___/__fixtures__/config.yaml';
|
this.config_path = './src/___tests___/__fixtures__/config.yaml';
|
||||||
this.https = {
|
this.https = {
|
||||||
enable: false,
|
enable: false,
|
||||||
|
@ -11,7 +11,7 @@ class Config implements VerdaccioConfigGoogleStorage {
|
|||||||
server_id: string;
|
server_id: string;
|
||||||
packages: PackageList;
|
packages: PackageList;
|
||||||
uplinks: UpLinksConfList;
|
uplinks: UpLinksConfList;
|
||||||
logs: LoggerConf[];
|
log: LoggerConfItem;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
security: Security;
|
security: Security;
|
||||||
$key: any;
|
$key: any;
|
||||||
@ -28,7 +28,7 @@ class Config implements VerdaccioConfigGoogleStorage {
|
|||||||
this.server_id = '';
|
this.server_id = '';
|
||||||
this.user_agent = '';
|
this.user_agent = '';
|
||||||
this.packages = {};
|
this.packages = {};
|
||||||
this.logs = [];
|
this.log = {};
|
||||||
this.kind = 'partial_test_metadataDatabaseKey';
|
this.kind = 'partial_test_metadataDatabaseKey';
|
||||||
this.bucket = 'verdaccio-plugin';
|
this.bucket = 'verdaccio-plugin';
|
||||||
this.projectId = 'verdaccio-01';
|
this.projectId = 'verdaccio-01';
|
||||||
|
@ -34,6 +34,4 @@ packages:
|
|||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
|
|
||||||
# log settings
|
# log settings
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: http }
|
||||||
- { type: stdout, format: pretty, level: http }
|
|
||||||
#- {type: file, path: verdaccio.log, level: info}
|
|
||||||
|
@ -32,13 +32,11 @@ export default class Config {
|
|||||||
proxy: [],
|
proxy: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
this.logs = [
|
this.log = {
|
||||||
{
|
|
||||||
type: 'stdout',
|
type: 'stdout',
|
||||||
format: 'pretty',
|
format: 'pretty',
|
||||||
level: 35,
|
level: 35,
|
||||||
},
|
};
|
||||||
];
|
|
||||||
this.config_path = './tests/__fixtures__/config.yaml';
|
this.config_path = './tests/__fixtures__/config.yaml';
|
||||||
this.https = {
|
this.https = {
|
||||||
enable: false,
|
enable: false,
|
||||||
|
@ -53,13 +53,11 @@ export default class Config {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
this.logs = [
|
this.log = {
|
||||||
{
|
|
||||||
type: 'stdout',
|
type: 'stdout',
|
||||||
format: 'pretty',
|
format: 'pretty',
|
||||||
level: 35,
|
level: 35,
|
||||||
},
|
};
|
||||||
];
|
|
||||||
|
|
||||||
this.config_path = './tests/__fixtures__/config.yaml';
|
this.config_path = './tests/__fixtures__/config.yaml';
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const config: Config = {
|
|||||||
title: 'string',
|
title: 'string',
|
||||||
logo: 'string',
|
logo: 'string',
|
||||||
},
|
},
|
||||||
logs: [],
|
log: {},
|
||||||
auth: {},
|
auth: {},
|
||||||
notifications: {
|
notifications: {
|
||||||
method: '',
|
method: '',
|
||||||
|
@ -59,5 +59,4 @@ middlewares:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
- { type: stdout, format: pretty, level: trace }
|
|
||||||
|
@ -28,4 +28,4 @@ server:
|
|||||||
middlewares:
|
middlewares:
|
||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
logs: { type: stdout, format: pretty, level: http }
|
log: { type: stdout, format: pretty, level: http }
|
||||||
|
@ -84,5 +84,4 @@ packages:
|
|||||||
publish: $all
|
publish: $all
|
||||||
unpublish: xxx
|
unpublish: xxx
|
||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: error }
|
||||||
- { type: stdout, format: pretty, level: error }
|
|
||||||
|
@ -11,5 +11,4 @@ packages:
|
|||||||
'*':
|
'*':
|
||||||
access: $all
|
access: $all
|
||||||
publish: $all
|
publish: $all
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -32,5 +32,4 @@ middlewares:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -9,5 +9,4 @@ packages:
|
|||||||
'**':
|
'**':
|
||||||
access: $all
|
access: $all
|
||||||
proxy: remote
|
proxy: remote
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -18,5 +18,4 @@ packages:
|
|||||||
'**':
|
'**':
|
||||||
access: $authenticated
|
access: $authenticated
|
||||||
publish: $authenticated
|
publish: $authenticated
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -21,5 +21,4 @@ packages:
|
|||||||
access: $all
|
access: $all
|
||||||
publish: $all
|
publish: $all
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -20,8 +20,7 @@ packages:
|
|||||||
'only-you-can-publish':
|
'only-you-can-publish':
|
||||||
access: $authenticated
|
access: $authenticated
|
||||||
publish: $authenticated
|
publish: $authenticated
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: error }
|
|
||||||
flags:
|
flags:
|
||||||
## enable token for testing
|
## enable token for testing
|
||||||
token: true
|
token: true
|
||||||
|
@ -17,5 +17,4 @@ packages:
|
|||||||
publish: $all
|
publish: $all
|
||||||
unpublish: xxx
|
unpublish: xxx
|
||||||
proxy: remote
|
proxy: remote
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: error }
|
|
||||||
|
@ -34,5 +34,4 @@ packages:
|
|||||||
access: $all
|
access: $all
|
||||||
publish: $all
|
publish: $all
|
||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -11,8 +11,7 @@ auth:
|
|||||||
name: test
|
name: test
|
||||||
password: test
|
password: test
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: trace }
|
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -34,5 +34,4 @@ packages:
|
|||||||
access: $all
|
access: $all
|
||||||
publish: $all
|
publish: $all
|
||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
@ -76,7 +76,7 @@ const configForTest = configDefault(
|
|||||||
url: `http://${DOMAIN_SERVERS}:${mockServerPort}`,
|
url: `http://${DOMAIN_SERVERS}:${mockServerPort}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
logs: [{ type: 'stdout', format: 'pretty', level: 'trace' }],
|
log: [{ type: 'stdout', format: 'pretty', level: 'trace' }],
|
||||||
},
|
},
|
||||||
'api.spec.yaml'
|
'api.spec.yaml'
|
||||||
);
|
);
|
||||||
|
@ -31,7 +31,7 @@ uplinks:
|
|||||||
baduplink:
|
baduplink:
|
||||||
url: http://localhost:55666/
|
url: http://localhost:55666/
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: info }
|
log: { type: stdout, format: pretty, level: info }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@test/*':
|
'@test/*':
|
||||||
|
@ -32,7 +32,7 @@ auth:
|
|||||||
name: authtest
|
name: authtest
|
||||||
password: blahblah-password
|
password: blahblah-password
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
packages:
|
packages:
|
||||||
'@test/*':
|
'@test/*':
|
||||||
access: $all
|
access: $all
|
||||||
|
@ -20,7 +20,7 @@ auth:
|
|||||||
name: test
|
name: test
|
||||||
password: test
|
password: test
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'pkg-gh131':
|
'pkg-gh131':
|
||||||
|
@ -48,4 +48,4 @@ packages:
|
|||||||
access: $all
|
access: $all
|
||||||
publish: $all
|
publish: $all
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: warns }
|
log: { type: stdout, format: pretty, level: warns }
|
||||||
|
@ -13,7 +13,7 @@ publish:
|
|||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -14,7 +14,7 @@ publish:
|
|||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: trace }
|
log: { type: stdout, format: pretty, level: trace }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
55
pnpm-lock.yaml
generated
55
pnpm-lock.yaml
generated
@ -494,12 +494,14 @@ importers:
|
|||||||
debug: 4.3.3
|
debug: 4.3.3
|
||||||
lodash: 4.17.21
|
lodash: 4.17.21
|
||||||
pino: 7.6.4
|
pino: 7.6.4
|
||||||
|
pino-pretty: 7.6.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@verdaccio/core': link:../core/core
|
'@verdaccio/core': link:../core/core
|
||||||
'@verdaccio/logger-prettify': link:../logger-prettify
|
'@verdaccio/logger-prettify': link:../logger-prettify
|
||||||
debug: 4.3.3
|
debug: 4.3.3
|
||||||
lodash: 4.17.21
|
lodash: 4.17.21
|
||||||
pino: 7.6.4
|
pino: 7.6.4
|
||||||
|
pino-pretty: 7.6.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@verdaccio/types': link:../core/types
|
'@verdaccio/types': link:../core/types
|
||||||
|
|
||||||
@ -10427,6 +10429,16 @@ packages:
|
|||||||
/argparse/2.0.1:
|
/argparse/2.0.1:
|
||||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||||
|
|
||||||
|
/args/5.0.1:
|
||||||
|
resolution: {integrity: sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==}
|
||||||
|
engines: {node: '>= 6.0.0'}
|
||||||
|
dependencies:
|
||||||
|
camelcase: 5.0.0
|
||||||
|
chalk: 2.4.2
|
||||||
|
leven: 2.1.0
|
||||||
|
mri: 1.1.4
|
||||||
|
dev: false
|
||||||
|
|
||||||
/argv/0.0.2:
|
/argv/0.0.2:
|
||||||
resolution: {integrity: sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=}
|
resolution: {integrity: sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=}
|
||||||
engines: {node: '>=0.6.10'}
|
engines: {node: '>=0.6.10'}
|
||||||
@ -11529,6 +11541,11 @@ packages:
|
|||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/camelcase/5.0.0:
|
||||||
|
resolution: {integrity: sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==}
|
||||||
|
engines: {node: '>=6'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/camelcase/5.3.1:
|
/camelcase/5.3.1:
|
||||||
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
|
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -12952,6 +12969,10 @@ packages:
|
|||||||
engines: {node: '>=0.11'}
|
engines: {node: '>=0.11'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/dateformat/4.6.3:
|
||||||
|
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/dayjs/1.10.7:
|
/dayjs/1.10.7:
|
||||||
resolution: {integrity: sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==}
|
resolution: {integrity: sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==}
|
||||||
|
|
||||||
@ -17605,6 +17626,11 @@ packages:
|
|||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/joycon/3.1.1:
|
||||||
|
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/js-base64/3.7.2:
|
/js-base64/3.7.2:
|
||||||
resolution: {integrity: sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==}
|
resolution: {integrity: sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -18062,6 +18088,11 @@ packages:
|
|||||||
verror: 1.10.0
|
verror: 1.10.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/leven/2.1.0:
|
||||||
|
resolution: {integrity: sha1-wuep93IJTe6dNCAq6KzORoeHVYA=}
|
||||||
|
engines: {node: '>=0.10.0'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/leven/3.1.0:
|
/leven/3.1.0:
|
||||||
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -19265,6 +19296,11 @@ packages:
|
|||||||
resolution: {integrity: sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==}
|
resolution: {integrity: sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/mri/1.1.4:
|
||||||
|
resolution: {integrity: sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==}
|
||||||
|
engines: {node: '>=4'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/mri/1.2.0:
|
/mri/1.2.0:
|
||||||
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
|
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
@ -20308,6 +20344,25 @@ packages:
|
|||||||
duplexify: 4.1.2
|
duplexify: 4.1.2
|
||||||
split2: 4.1.0
|
split2: 4.1.0
|
||||||
|
|
||||||
|
/pino-pretty/7.6.0:
|
||||||
|
resolution: {integrity: sha512-sCthHDn8umVSlxEsOFakXZTNoCiTKYEuPwPXMDGq29QDt/38HEmVIKLxmgFLLg1RkLl4Dfxzp9Spz9pAtSBq0Q==}
|
||||||
|
hasBin: true
|
||||||
|
dependencies:
|
||||||
|
args: 5.0.1
|
||||||
|
colorette: 2.0.16
|
||||||
|
dateformat: 4.6.3
|
||||||
|
fast-safe-stringify: 2.1.1
|
||||||
|
joycon: 3.1.1
|
||||||
|
on-exit-leak-free: 0.2.0
|
||||||
|
pino-abstract-transport: 0.5.0
|
||||||
|
pump: 3.0.0
|
||||||
|
readable-stream: 3.6.0
|
||||||
|
rfdc: 1.3.0
|
||||||
|
secure-json-parse: 2.4.0
|
||||||
|
sonic-boom: 2.2.3
|
||||||
|
strip-json-comments: 3.1.1
|
||||||
|
dev: false
|
||||||
|
|
||||||
/pino-std-serializers/3.2.0:
|
/pino-std-serializers/3.2.0:
|
||||||
resolution: {integrity: sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==}
|
resolution: {integrity: sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==}
|
||||||
|
|
||||||
|
@ -40,5 +40,4 @@ middlewares:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: json, level: warn }
|
|
||||||
|
@ -21,8 +21,7 @@ uplinks:
|
|||||||
keepAlive: true
|
keepAlive: true
|
||||||
maxSockets: 40
|
maxSockets: 40
|
||||||
maxFreeSockets: 10
|
maxFreeSockets: 10
|
||||||
logs:
|
logs: { type: stdout, format: pretty, level: warn }
|
||||||
- { type: stdout, format: pretty, level: warn }
|
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
## ui-theme still lives outside of the core project
|
## ui-theme still lives outside of the core project
|
||||||
|
@ -14,7 +14,7 @@ auth:
|
|||||||
name: test
|
name: test
|
||||||
password: test
|
password: test
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: info }
|
log: { type: stdout, format: pretty, level: info }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'protected-*':
|
'protected-*':
|
||||||
|
@ -14,7 +14,7 @@ auth:
|
|||||||
name: test
|
name: test
|
||||||
password: test
|
password: test
|
||||||
|
|
||||||
logs: { type: stdout, format: pretty, level: info }
|
log: { type: stdout, format: pretty, level: info }
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'@*/*':
|
'@*/*':
|
||||||
|
@ -26,8 +26,7 @@ packages:
|
|||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
"**":
|
"**":
|
||||||
proxy: npmjs
|
proxy: npmjs
|
||||||
logs:
|
log: { type: stdout, format: pretty, level: http }
|
||||||
- { type: stdout, format: pretty, level: http }
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sections {#sections}
|
## Sections {#sections}
|
||||||
|
@ -7,14 +7,14 @@ As with any web application, Verdaccio has a customisable built-in logger. You c
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# console output
|
# console output
|
||||||
logs: { type: stdout, format: pretty, level: http }
|
log: { type: stdout, format: pretty, level: http }
|
||||||
```
|
```
|
||||||
|
|
||||||
or file output.
|
or file output.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# file output
|
# file output
|
||||||
logs: { type: file, path: verdaccio.log, level: info }
|
log: { type: file, path: verdaccio.log, level: info }
|
||||||
```
|
```
|
||||||
|
|
||||||
> Verdaccio 5 does not support rotation file anymore, [here more details](https://verdaccio.org/blog/2021/04/14/verdaccio-5-migration-guide#pinojs-is-the-new-logger).
|
> Verdaccio 5 does not support rotation file anymore, [here more details](https://verdaccio.org/blog/2021/04/14/verdaccio-5-migration-guide#pinojs-is-the-new-logger).
|
||||||
|
@ -35,13 +35,11 @@ let config = {
|
|||||||
proxy: "npmjs"
|
proxy: "npmjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logs: [
|
log: {
|
||||||
{
|
|
||||||
type: "stdout",
|
type: "stdout",
|
||||||
format: "pretty",
|
format: "pretty",
|
||||||
level: "http",
|
level: "http",
|
||||||
}
|
};
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
startServer(
|
startServer(
|
||||||
|
Loading…
Reference in New Issue
Block a user