@uoa/lambda-tracing
Version:
Library for logging & distributed tracing in UoA Lambda projects
64 lines (63 loc) • 2.14 kB
TypeScript
import { Logger, LoggerOptions } from "winston";
/**
* Audit information to describe who is accessing a sensitive or confidential resource.
*/
export interface AuditInformation {
/**
* Application name that groups different physical systems into a single logical group.
* For example, this may be the front end system name so that multiple backend system logs can be grouped together.
*/
application?: string;
/**
* The ID of the user who is accessing the resource.
*/
accessedBy: string;
/**
* The action taken on the resource.
*/
action: 'read' | 'update' | 'create' | 'delete';
/**
* The ID of the owner of the resource information.
*/
ownerId: string;
/**
* The type of resource accessed. For example, "application" or "enrolment".
* By convention this value should be singular.
*/
resourceType: string;
/**
* The unique resource identifier. For example, the application number.
* This is not required if the resource identifier is the same as the owner.
*/
resourceId?: string;
}
export declare class UoaLogger {
logger: Logger;
constructor(options: LoggerOptions);
/**
* Function to log debug level messages.
* @param {string} message - Debug message.
*/
debug(message: string): void;
/**
* Function to log info level messages.
* @param {string} message - Information message.
*/
info(message: string): void;
/**
* Function to log audit level messages.
* @param {AuditInformation} auditInformation - Audit Information object containing relevant details.
* @param {string=} message - Audit message (optional).
*/
audit(auditInformation: AuditInformation, message?: string): void;
/**
* Function to log warn level messages.
* @param {string} message - Warn message.
*/
warn(message: string): void;
/**
* Function to log error level messages.
* @param {string} message - Error message.
*/
error(message: string): void;
}