Skip to content
Snippets Groups Projects
Commit e53baa20 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

feat: add log level from env vars

parent 272d718c
No related branches found
No related tags found
1 merge request!66feat: add log level from env vars
Pipeline #69652 passed
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
CredentialEventTypes, CredentialEventTypes,
HttpOutboundTransport, HttpOutboundTransport,
InitConfig, InitConfig,
LogLevel,
ProofEventTypes, ProofEventTypes,
TypedArrayEncoder, TypedArrayEncoder,
WsOutboundTransport, WsOutboundTransport,
...@@ -52,7 +51,7 @@ export class AskarService implements OnModuleInit, OnModuleDestroy { ...@@ -52,7 +51,7 @@ export class AskarService implements OnModuleInit, OnModuleDestroy {
const config = { const config = {
label: this.agentConfig.agentName, label: this.agentConfig.agentName,
logger: new ConsoleLogger(LogLevel.debug), logger: new ConsoleLogger(this.agentConfig.logLevel),
walletConfig: { walletConfig: {
storage: { storage: {
type: "postgres", type: "postgres",
......
import { registerAs } from "@nestjs/config"; import { registerAs } from "@nestjs/config";
import * as process from "process"; import * as process from "process";
import { IConfAgent } from "../interfaces/agent.config.interface"; import { IConfAgent } from "../interfaces/agent.config.interface";
import { LogLevel } from "@aries-framework/core";
export const agentConfig = registerAs( export const agentConfig = registerAs(
"agent", "agent",
...@@ -34,5 +35,6 @@ export const agentConfig = registerAs( ...@@ -34,5 +35,6 @@ export const agentConfig = registerAs(
agentAuthBasicPass: process.env["AUTH_BASIC_PASS"]!, agentAuthBasicPass: process.env["AUTH_BASIC_PASS"]!,
agentAuthJwtEnabled: !!process.env["AUTH_JWT_PUBLIC_KEY"], agentAuthJwtEnabled: !!process.env["AUTH_JWT_PUBLIC_KEY"],
agentAuthJwtPublicKey: process.env["AUTH_JWT_PUBLIC_KEY"]!, agentAuthJwtPublicKey: process.env["AUTH_JWT_PUBLIC_KEY"]!,
logLevel: parseInt(process.env["LOG_LEVEL"]!) || LogLevel.error,
}), }),
); );
...@@ -24,4 +24,6 @@ export interface IConfAgent { ...@@ -24,4 +24,6 @@ export interface IConfAgent {
agentAuthBasicPass: string; agentAuthBasicPass: string;
agentAuthJwtEnabled: boolean; agentAuthJwtEnabled: boolean;
agentAuthJwtPublicKey: string; agentAuthJwtPublicKey: string;
logLevel: number;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment