Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ballerina/natives.bal
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ public type Valuer isolated function () returns anydata;
# Key-Value pairs that needs to be displayed in the log.
#
# + msg - msg which cannot be a key
# + message - message which cannot be a key
# + time - time which cannot be a key
# + level - level which cannot be a key
# + 'error - 'error which cannot be a key
# + stackTrace - error stack trace which cannot be a key
# + stackTrace - stackTrace which cannot be a key
public type KeyValues record {|
never msg?;
never message?;
never time?;
never level?;
never 'error?;
never stackTrace?;
Value...;
Expand All @@ -59,6 +65,12 @@ public type KeyValues record {|
public type AnydataKeyValues record {
# msg which cannot be a key
never msg?;
# message which cannot be a key
never message?;
# time which cannot be a key
never time?;
# level which cannot be a key
never level?;
# 'error which cannot be a key
never 'error?;
# stackTrace which cannot be a key
Expand Down
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log
This file contains all the notable changes done to the Ballerina TCP package through the releases.
This file contains all the notable changes done to the Ballerina Log package through the releases.

## [Unreleased]

### Fixed

- [Passing time as key in KeyValue pair replaces the logged time with the context value](https://github.com/ballerina-platform/ballerina-library/issues/7728)
- [Passing message as key in KeyValue pair replaces the logged message with the context value](https://github.com/ballerina-platform/ballerina-library/issues/8232)

## [2.14.0] - 2025-10-09

Expand Down
4 changes: 4 additions & 0 deletions docs/spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ time=2025-08-20T08:53:29.987+05:30 level=INFO module="" message="info log" curre
time=2025-08-20T08:53:29.998+05:30 level=INFO module="" message="info log for id: 845315" ctx="{name: foo}"
```

> **Note:**
> The key-value pairs provided for logging must not use the reserved keys `message`, `time`, or `level`.
> These keys are reserved for the log record fields and will result in a compile-time error if specified.

## 3. Configure logging

### 3.1. Configure root log level
Expand Down