Skip to content

Commit

Permalink
fix(serverless): resolved printing debug logs by default (#1317)
Browse files Browse the repository at this point in the history
refs #1316

Co-authored-by: kirrg001 <[email protected]>
  • Loading branch information
aryamohanan and kirrg001 authored Sep 6, 2024
1 parent 0e9b6a0 commit d5dfbd7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/aws-fargate/src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ const { normalizeConfig } = coreUtil;
let logger = consoleLogger;

const config = normalizeConfig({});
config.logger = logger;

function init() {
// NOTE: We accept for `process.env.INSTANA_DEBUG` any string value - does not have to be "true".
if (process.env.INSTANA_DEBUG || process.env.INSTANA_LOG_LEVEL) {
logger.setLevel(process.env.INSTANA_DEBUG ? 'debug' : process.env.INSTANA_LOG_LEVEL);
}
Expand Down
1 change: 1 addition & 0 deletions packages/aws-lambda/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ function init(event, arnInfo, _config) {
config.logger = logger;
}

// NOTE: We accept for `process.env.INSTANA_DEBUG` any string value - does not have to be "true".
if (process.env.INSTANA_DEBUG || config.level || process.env.INSTANA_LOG_LEVEL) {
logger.setLevel(process.env.INSTANA_DEBUG ? 'debug' : config.level || process.env.INSTANA_LOG_LEVEL);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/azure-container-services/src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ const { normalizeConfig } = coreUtil;
let logger = consoleLogger;

const config = normalizeConfig({});
config.logger = logger;

function init() {
// NOTE: We accept for `process.env.INSTANA_DEBUG` any string value - does not have to be "true".
if (process.env.INSTANA_DEBUG || process.env.INSTANA_LOG_LEVEL) {
logger.setLevel(process.env.INSTANA_DEBUG ? 'debug' : process.env.INSTANA_LOG_LEVEL);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/google-cloud-run/src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ const { normalizeConfig } = coreUtil;
let logger = consoleLogger;

const config = normalizeConfig({});
config.logger = logger;

function init() {
// NOTE: We accept for `process.env.INSTANA_DEBUG` any string value - does not have to be "true".
if (process.env.INSTANA_DEBUG || process.env.INSTANA_LOG_LEVEL) {
logger.setLevel(process.env.INSTANA_DEBUG ? 'debug' : process.env.INSTANA_LOG_LEVEL);
}
Expand Down
1 change: 1 addition & 0 deletions packages/opentelemetry-exporter/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class InstanaExporter {

// https://github.com/open-telemetry/opentelemetry-js/pull/3627
// NOTE: We are not using the Instana logger. We are using Otel API diag component.
// NOTE: We accept for `process.env.INSTANA_DEBUG` any string value - does not have to be "true".
if (process.env.INSTANA_DEBUG || process.env.INSTANA_LOG_LEVEL) {
process.env.OTEL_LOG_LEVEL = process.env.INSTANA_DEBUG ? 'debug' : process.env.INSTANA_LOG_LEVEL;
}
Expand Down
1 change: 1 addition & 0 deletions packages/serverless-collector/src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { normalizeConfig } = coreUtil;
let logger = consoleLogger;

const config = normalizeConfig({});
config.logger = logger;

function init() {
if (process.env.INSTANA_DEBUG || process.env.INSTANA_LOG_LEVEL) {
Expand Down

0 comments on commit d5dfbd7

Please sign in to comment.