# LOG

Calculates the logarithm of a numeric value to a specified base. If the base is not provided, it defaults to the natural logarithm (base e).

## Syntax

`LOG(base, number)`

### Parameters

#### `base`

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

#### `number`

- Numeric expression. If `null`, the function returns `null`.

## Examples

Logarithm with a specified base

Calculate the logarithm of 8 to base 2:

```esql
ROW base = 2.0, value = 8.0
| EVAL s = LOG(base, value)
```

Natural logarithm (base e)

Calculate the natural logarithm of 100:

```esql
ROW value = 100
| EVAL s = LOG(value)
```

## Limitations

- Logs of zero, negative numbers, and a base of one return `null` and generate a warning.
