# LOG

The LOG function calculates the logarithm of a numeric value to a specified base. The result is always a double. If the input value is zero, negative, or the base is one, the function returns `null` and issues a warning.

## Syntax

`LOG(base, number)`

### Parameters

#### base

Base of the logarithm. If `null`, the function returns `null`. If not provided, the function returns the natural logarithm (base e) of the value.

#### number

Numeric expression to compute the logarithm for. If `null`, the function returns `null`.

## Examples

Calculates the logarithm of 8 with base 2.
```esql
ROW base = 2.0, value = 8.0
| EVAL s = LOG(base, value)
```

Calculates the natural logarithm (base e) of 100.
```esql
ROW value = 100
| EVAL s = LOG(value);
```