# LogApi (Logging APIs)

## setLogLevel

Sets the log level. The valid values are debug, info(default), warning or error

```
LogApi.setLogLevel(String logLevel)
```

**Parameters**

```
logLevel:    level
```

**Returns**

```
result of operation​
```

## disableAuditLog

Disables the audit log, which is used for logging to Trillo DB. By default it is enabled

```
LogApi.disableAuditLog()
```

**Parameters**

```
none​
```

**Returns**

```
result of the operation​
```

## enableAuditLog

Enables the audit log. This is the default option and is used for logging into Trillo DB. Helps  in isolating errors per task

```
LogApi.enableAuditLog()
```

**Parameters**

```
none​
```

**Returns**

```
result of the operation​
```

## disableLogsCollection

Disable log collections for the thread. Logs are collected for ac all and sent back to the client in the result. This is useful in debugging. By default it is disabled

```
LogApi.disableLogsCollection()
```

**Parameters**

```
none​
```

**Returns**

```
result of the operation​
```

## enableLogsCollection

Enable log collections for the thread

```
LogApi.enableLogsCollection()
```

**Parameters**

```
none​
```

**Returns**

```
result of the operation​
```

## logDebug

logging of the debug and verbose messages. ​

```
LogApi.logDebug(String msg) 
```

**Parameters**

```
msg:   message string
```

**Returns**

```
result of the operation​
```

## logInfo

logging an informational and occasional message​.

```
LogApi. logInfo(String msg) 
```

**Parameters**

```
msg:  message 
```

**Returns**

```
result of the operation​
```

## logWarn

Provides a warning message

```
LogApi.logWarn(String msg)
```

**Parameters**

```
msg: message
```

**Returns**

```
result of the operation​
```

## logError

Provides an error message

```
LogApi.logError(String msg)
```

**Parameters**

```
msg: message
```

**Returns**

```
result of the operation​
```

## isLogLevelOn

Describes if the log level is on and returns a boolean.

```
LogApi.isLogLevelOn(String type)
```

**Parameters**

```
type:   type of the logging
```

**Returns**

```
result of the operation​
```

## auditLog

Sends an audit message to the workbench. It can be viewed under the task logs.​

```
LogApi.auditLog(Map<String, Object> logObject)
or
LogApi.auditLog(String type, String summary, String ...args)
```

**Parameters**

```
Map<String, Object>: hashmap
logObject: object representing hashmap
summary:  a sentence with tokens
...args: arguments to be replaced
type:  type of the log
```

**Returns**

```
result of the operation​
```

## \_auditLog

// Description //

```
LogApi._auditLog(String type, String summary, String detail, String json, String action, String sourceUid)
```

#### Parameters

```
summary
detail
json
action
sourceUid
```

#### Returns

```
// Some code
```

## auditLogInfo

This provides the information stored in the Audit log object which includes detailed log message, any associated json object, action and the parent id.

```
LogApi.auditLogInfo(String summary, String ...args) 
```

**Parameters**

```
summary: a sentence with tokens
...args:  the value of the tokens
```

**Returns**

```
result of the operation​
```

## auditLogError

Provides information about the error in the Audit log object

```
LogApi.auditLogError(String summary, String ...args)
```

**Parameters**

```
summary:
...args:
```

**Returns**

```
```

## canAuditLog

For a given logging type, checks whether audit messages can be recorded

```
LogApi.canAuditLog(String type) 
```

**Parameters**

```
type: logging type
```

**Returns**

```
```

## logToConsole

Logs the appropriate messages to the console

```
LogApi.logToConsole(String type, String msg)
```

**Parameters**

```
type:
msg:
```

**Returns**

```
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillo.gitbook.io/trillo-workbench-java-sdk/log-api-logapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
