Note(Kelosky): it seems from the log4js doc that you only get a single instance of log4js per category. To reconfigure, you should "shutdown" logger.

### Hierarchy

- Logger

## Index

### Constructors

- constructor

### Properties

- category
- initStatus
- mJsLogger
- DEFAULT_APP_NAME
- DEFAULT_CONSOLE_NAME
- DEFAULT_IMPERATIVE_NAME
- DEFAULT_VALID_LOG_LEVELS

### Accessors

- level
- logService

### Methods

- debug
- error
- fatal
- getCallerFileAndLineTag
- info
- logError
- simple
- trace
- warn
- getAppLogger
- getConsoleLogger
- getImperativeLogger
- getLoggerCategory
- initLogger
- isValidLevel
- setLogInMemory
- writeInMemoryMessages

## Constructors

### constructor

- new Logger(mJsLogger: log4js.Logger | Console, category?: string): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:153

  #### Parameters

  - ##### mJsLogger: log4js.Logger | Console

  - ##### Optional category: string

  #### Returns Logger

## Properties

### Private Optional category

category: string

- Defined in @zowe/imperative/src/logger/src/Logger.ts:155

### Private initStatus

initStatus: boolean

- Defined in @zowe/imperative/src/logger/src/Logger.ts:153

This flag is being used to monitor the log4js configure status.

### Private mJsLogger

mJsLogger: log4js.Logger | Console

- Defined in @zowe/imperative/src/logger/src/Logger.ts:155

### Static Readonly DEFAULT_APP_NAME

DEFAULT_APP_NAME: "app" = "app"

- Defined in @zowe/imperative/src/logger/src/Logger.ts:30

### Static Readonly DEFAULT_CONSOLE_NAME

DEFAULT_CONSOLE_NAME: "console" = "console"

- Defined in @zowe/imperative/src/logger/src/Logger.ts:31

### Static Readonly DEFAULT_IMPERATIVE_NAME

DEFAULT_IMPERATIVE_NAME: "imperative" = "imperative"

- Defined in @zowe/imperative/src/logger/src/Logger.ts:29

### Static Readonly DEFAULT_VALID_LOG_LEVELS

DEFAULT_VALID_LOG_LEVELS: string[] = ["ALL", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "MARK", "OFF"]

- Defined in @zowe/imperative/src/logger/src/Logger.ts:32

## Accessors

### level

- get level(): string
- set level(level: string): void

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:380

  Get current level setting

  #### Returns string

  - level of current log setting
- - Defined in @zowe/imperative/src/logger/src/Logger.ts:372

  Allow for programmatic adjustments to the logger

  #### Parameters

  - ##### level: string

    new level to set

  #### Returns void

  - level of current log setting

### Private logService

- get logService(): any
- set logService(service: log4js.Logger | Console): void

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:390

  Get underlying logger service

  This function also check to see if log4js is configured since the last time it was called. If yes, then update the logger with to leverage the new configuration.

  #### Returns any

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:403

  Set underlying logger service

  This function also check to see if log4js is configured since the last time it was called. If yes, then update the logger with to leverage the new configuration.

  #### Parameters

  - ##### service: log4js.Logger | Console

  #### Returns void

## Methods

### debug

- debug(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:196

  Log a message at the "debug" level Example: 'Got cheese'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### error

- error(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:249

  Log a message at the "error" level Example: 'Cheese is too ripe!'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### fatal

- fatal(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:266

  Log a message at the "fatal" level Example: 'Cheese was breeding ground for listeria.'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### Private getCallerFileAndLineTag

- getCallerFileAndLineTag(): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:352

  Obtain .js file name and line number which issued the log message. NOTE(Kelosky): Consensus seems to be that this may produce a lot of overhead by creating an Error and obtaining stack information for EVERY log message that is issued.

  There are also packages available to obtain the appropriate line number.

  Perhaps when a package pops up that gives the appropriate .ts line number and file name, we'll remove usage of this method.

  #### Returns string

  - file and line number

### info

- info(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:214

  Log a message at the "info" level Example: 'Cheese is Gouda'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### logError

- logError(err: ImperativeError): void

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:297

  Log an Imperative error, including any optional fields if present

  #### Parameters

  - ##### err: ImperativeError

    the error to log

  #### Returns void

### simple

- simple(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:283

  Log a message without CallerFileAndLineTag Example: 'Cheese that is plain'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### trace

- trace(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:178

  Log a message at the "trace" level Example: 'Entering cheese testing'

  #### Parameters

  - ##### message: string

    printf style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf style args

  #### Returns string

### warn

- warn(message: string, ...args: any[]): string

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:232

  Log a message at the "warn" level Example: 'Cheese is quite smelly.'

  #### Parameters

  - ##### message: string

    printf or mustache style template string, or a plain string message

  - ##### Rest ...args: any[]

    printf or mustache style args

  #### Returns string

### Static getAppLogger

- getAppLogger(): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:61

  Get log4js instance directed at our app's category.

  #### Returns Logger

  - instance of logger set to our app's category

### Static getConsoleLogger

- getConsoleLogger(): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:105

  Return an instance to the console logger which applies TextUtils invoked through this Logger class.

  Note(Kelosky): this is not the same as obtaining a new Console() directly, since we can make use of the internationalization and other routines within this Logger class via this implementation.

  #### Returns Logger

  - instance of logger set to our app's category

### Static getImperativeLogger

- getImperativeLogger(): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:53

  Get accessibility to logging service to invoke log calls, e.g Logger.getLogger.info("important log info goes here");

  #### Returns Logger

  - instance of logger set to our app's category

### Static getLoggerCategory

- getLoggerCategory(category: string): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:40

  Get accessibility to logging service to invoke log calls, e.g Logger.getLogger.info("important log info goes here");

  #### Parameters

  - ##### category: string

    category of logger to obtain

  #### Returns Logger

  - instance of logger set to our app's category

### Static initLogger

- initLogger(loggingConfig: IConfigLogging): Logger

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:115

  Get an instance of logging and adjust for config if config is present; otherwise, use defaults.

  #### Parameters

  - ##### loggingConfig: IConfigLogging

  #### Returns Logger

  [description]

### Static isValidLevel

- isValidLevel(testLevel: string): boolean

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:86

  Test if the input level is a valid value for Log4js.

  #### Parameters

  - ##### testLevel: string

    input level to be tested

  #### Returns boolean

  - status if the input level is valid

### Static setLogInMemory

- setLogInMemory(status: boolean, maxQueueSize?: number): void

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:65

  #### Parameters

  - ##### status: boolean

  - ##### Optional maxQueueSize: number

  #### Returns void

### Static writeInMemoryMessages

- writeInMemoryMessages(file: string): void

- - Defined in @zowe/imperative/src/logger/src/Logger.ts:77

  Write all messages that was stored in memory to the input file.

  #### Parameters

  - ##### file: string

    destination file name

  #### Returns void

Generated using TypeDoc