My app engine application deployed fine before setting this variable. Now when I deploy the application the build is looking for this local file. Can i set this as a relative path or can I remove this variable and use new logger({ projectId, relative/path/to/json })
in my logger utils?
const {Logging} = require('@google-cloud/logging');
export const gCloudLogging = new Logging({ ... make this change here });
export const logName = 'API';
export const log = gCloudLogging.log(logName);
export const resource = {
"type": "global",
"displayName": "...",
"description": "..."
};
export const severity = {
DEFAULT: 'DEFAULT', //(0) The log entry has no assigned severity level.
DEBUG: 'DEBUG', //(100) Debug or trace information.
INFO: 'INFO', //(200) Routine information, such as ongoing status or performance.
NOTICE: 'NOTICE', //(300) Normal but significant events, such as start up, shut down, or a configuration change.
WARNING: 'WARNING', //(400) Warning events might cause problems.
ERROR: 'ERROR', //(500) Error events are likely to cause problems.
CRITICAL: 'CRITICAL', //(600) Critical events cause more severe problems or outages.
ALERT: 'ALERT', //(700) A person must take an action immediately.
EMERGENCY: 'EMERGENCY', //(800) One or more systems are unusable.
};
export const writeLog = (severity: string, text: string): void => {
const metaData = {
resource,
severity
};
const entry = log.entry(metaData, text);
log.write(entry);
}