From 17f71965e8e8e198ef6e32b97b367b7e30487d58 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Fri, 3 Oct 2025 11:22:45 +0530 Subject: [PATCH 01/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 14 +++++++------- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 731b7cf5..98490174 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "log" -version = "2.13.0" +version = "2.14.0" authors = ["Ballerina"] keywords = ["level", "format"] repository = "https://github.com/ballerina-platform/module-ballerina-log" @@ -15,18 +15,18 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-native" -version = "2.13.0" -path = "../native/build/libs/log-native-2.13.0.jar" +version = "2.14.0" +path = "../native/build/libs/log-native-2.14.0.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-compiler-plugin" -version = "2.13.0" -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.13.0.jar" +version = "2.14.0" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.14.0.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-test-utils" -version = "2.13.0" -path = "../test-utils/build/libs/log-test-utils-2.13.0.jar" +version = "2.14.0" +path = "../test-utils/build/libs/log-test-utils-2.14.0.jar" scope = "testOnly" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 5f2950e8..3b2ead9b 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "log-compiler-plugin" class = "io.ballerina.stdlib.log.compiler.LogCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.13.0.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.14.0.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index b869132d..0fcfc01f 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.0" [[package]] org = "ballerina" @@ -76,7 +76,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.13.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -91,7 +91,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From b39230a9a28ce3cec3f3056bd4e5b41d7331d334 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 16 Oct 2025 10:57:36 +0530 Subject: [PATCH 02/11] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 0fcfc01f..3bf3c402 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.13.0" +distribution-version = "2201.13.0-20251016-073200-0d348172" [[package]] org = "ballerina" From 45ab63061b2b009773b977d1d7ece7f2377c6057 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 16 Oct 2025 10:59:22 +0530 Subject: [PATCH 03/11] Add ICP tags to log message if ICP agent running --- ballerina/root_logger.bal | 19 +++++++++++++++++++ gradle.properties | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ballerina/root_logger.bal b/ballerina/root_logger.bal index 1ac6a692..b7a69c96 100644 --- a/ballerina/root_logger.bal +++ b/ballerina/root_logger.bal @@ -139,6 +139,25 @@ isolated class RootLogger { logRecord[k] = v; } } + if observe:isObservabilityEnabled() { + string? runtimeId = observe:getTagValue("runtime"); + if runtimeId is string { + logRecord["runtime"] = runtimeId; + } + string? componentId = observe:getTagValue("component"); + if componentId is string { + logRecord["component"] = componentId; + } + string? environmentId = observe:getTagValue("environment"); + if environmentId is string { + logRecord["environment"] = environmentId; + } + string? projectId = observe:getTagValue("project"); + if projectId is string { + logRecord["project"] = projectId; + } + } + foreach [string, Value] [k, v] in self.keyValues.entries() { logRecord[k] = v is Valuer ? v() : v is PrintableRawTemplate ? processMessage(v) : v; } diff --git a/gradle.properties b/gradle.properties index 3760f448..2f4e3b90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.stdlib -version=2.13.1-SNAPSHOT -ballerinaLangVersion=2201.12.0 +version=2.14.0-SNAPSHOT +ballerinaLangVersion=2201.13.0-20251016-073200-0d348172 checkstylePluginVersion=10.12.0 spotbugsPluginVersion=6.0.18 @@ -15,6 +15,6 @@ jacksonDatabindVersion=2.17.2 #stdlib dependencies stdlibIoVersion=1.8.0 -observeVersion=1.5.0 +observeVersion=1.6.0-20251016-103500-bf7ffd2 observeInternalVersion=1.5.0 testngVersion=6.14.3 From 6cf8f459ff6a655fe3dd573d54a142e5a2dc2054 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 16 Oct 2025 14:50:01 +0530 Subject: [PATCH 04/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 14 +++++++------- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 98490174..cab0dc02 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "log" -version = "2.14.0" +version = "2.15.0" authors = ["Ballerina"] keywords = ["level", "format"] repository = "https://github.com/ballerina-platform/module-ballerina-log" @@ -15,18 +15,18 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-native" -version = "2.14.0" -path = "../native/build/libs/log-native-2.14.0.jar" +version = "2.15.0" +path = "../native/build/libs/log-native-2.15.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-compiler-plugin" -version = "2.14.0" -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.14.0.jar" +version = "2.15.0" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-test-utils" -version = "2.14.0" -path = "../test-utils/build/libs/log-test-utils-2.14.0.jar" +version = "2.15.0" +path = "../test-utils/build/libs/log-test-utils-2.15.0-SNAPSHOT.jar" scope = "testOnly" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 3b2ead9b..23972feb 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "log-compiler-plugin" class = "io.ballerina.stdlib.log.compiler.LogCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.14.0.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 3bf3c402..ef88d16f 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -76,7 +76,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, From 338370b2ff5a4529fe037c41b6c2e4e0ec2d01cc Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 16 Oct 2025 14:50:59 +0530 Subject: [PATCH 05/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index cab0dc02..94495ae9 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -16,17 +16,17 @@ graalvmCompatible = true groupId = "io.ballerina.stdlib" artifactId = "log-native" version = "2.15.0" -path = "../native/build/libs/log-native-2.15.0-SNAPSHOT.jar" +path = "../native/build/libs/log-native-2.15.0.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-compiler-plugin" version = "2.15.0" -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-test-utils" version = "2.15.0" -path = "../test-utils/build/libs/log-test-utils-2.15.0-SNAPSHOT.jar" +path = "../test-utils/build/libs/log-test-utils-2.15.0.jar" scope = "testOnly" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 23972feb..15b8f5e6 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "log-compiler-plugin" class = "io.ballerina.stdlib.log.compiler.LogCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0.jar" From 02ef375cc5789a96d08dce52f31264dd6ee5e08c Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 13:36:17 +0530 Subject: [PATCH 06/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 94495ae9..cab0dc02 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -16,17 +16,17 @@ graalvmCompatible = true groupId = "io.ballerina.stdlib" artifactId = "log-native" version = "2.15.0" -path = "../native/build/libs/log-native-2.15.0.jar" +path = "../native/build/libs/log-native-2.15.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-compiler-plugin" version = "2.15.0" -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "log-test-utils" version = "2.15.0" -path = "../test-utils/build/libs/log-test-utils-2.15.0.jar" +path = "../test-utils/build/libs/log-test-utils-2.15.0-SNAPSHOT.jar" scope = "testOnly" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 15b8f5e6..23972feb 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "log-compiler-plugin" class = "io.ballerina.stdlib.log.compiler.LogCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0.jar" +path = "../compiler-plugin/build/libs/log-compiler-plugin-2.15.0-SNAPSHOT.jar" From 7a39711a66424ceb55c0410a6bbdf5322aa7291d Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 13:38:09 +0530 Subject: [PATCH 07/11] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index ef88d16f..377fd97d 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.13.0-20251016-073200-0d348172" +distribution-version = "2201.13.0" [[package]] org = "ballerina" @@ -91,7 +91,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.6.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From a80dd75a2b844224a800387ef7c3ea30b0aac4e0 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 13:38:51 +0530 Subject: [PATCH 08/11] Remove unneccessary tags --- ballerina/root_logger.bal | 16 ++-------------- gradle.properties | 6 +++--- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ballerina/root_logger.bal b/ballerina/root_logger.bal index 1c5f32e2..31b05481 100644 --- a/ballerina/root_logger.bal +++ b/ballerina/root_logger.bal @@ -148,21 +148,9 @@ isolated class RootLogger { } } if observe:isObservabilityEnabled() { - string? runtimeId = observe:getTagValue("runtime"); + string? runtimeId = observe:getTagValue("icp.runtime"); if runtimeId is string { - logRecord["runtime"] = runtimeId; - } - string? componentId = observe:getTagValue("component"); - if componentId is string { - logRecord["component"] = componentId; - } - string? environmentId = observe:getTagValue("environment"); - if environmentId is string { - logRecord["environment"] = environmentId; - } - string? projectId = observe:getTagValue("project"); - if projectId is string { - logRecord["project"] = projectId; + logRecord["icp.runtime"] = runtimeId; } } diff --git a/gradle.properties b/gradle.properties index aa094b9b..191952ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=2.15.0-SNAPSHOT -ballerinaLangVersion=2201.13.0-20251016-073200-0d348172 +ballerinaLangVersion=2201.13.0 checkstylePluginVersion=10.12.0 spotbugsPluginVersion=6.0.18 @@ -15,6 +15,6 @@ jacksonDatabindVersion=2.17.2 #stdlib dependencies stdlibIoVersion=1.8.0 -observeVersion=1.6.0-20251016-103500-bf7ffd2 -observeInternalVersion=1.5.0 +observeVersion=1.7.0 +observeInternalVersion=1.7.0 testngVersion=6.14.3 From 134e83c3948dfe3da6b4646ebcbe81624098dfa2 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 14:17:26 +0530 Subject: [PATCH 09/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index cab0dc02..abc671fc 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -7,7 +7,7 @@ keywords = ["level", "format"] repository = "https://github.com/ballerina-platform/module-ballerina-log" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.12.0" +distribution = "2201.13.0" [platform.java21] graalvmCompatible = true From 300af022948cbfa477c055c635edc0265e7c5865 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 14:19:01 +0530 Subject: [PATCH 10/11] Address review suggestions --- ballerina/natives.bal | 4 ++++ ballerina/root_logger.bal | 4 ++-- build-config/resources/Ballerina.toml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ballerina/natives.bal b/ballerina/natives.bal index 32b2c2e0..bb88ff08 100644 --- a/ballerina/natives.bal +++ b/ballerina/natives.bal @@ -51,6 +51,7 @@ public type Valuer isolated function () returns anydata; # + level - level which cannot be a key # + 'error - 'error which cannot be a key # + stackTrace - stackTrace which cannot be a key +# + icp\.runtimeId - icp.runtimeId which cannot be a key public type KeyValues record {| never msg?; never message?; @@ -58,6 +59,7 @@ public type KeyValues record {| never level?; never 'error?; never stackTrace?; + never icp\.runtimeId?; Value...; |}; @@ -77,6 +79,8 @@ public type AnydataKeyValues record { never stackTrace?; # module name which cannot be a key never module?; + # icp.runtimeId which cannot be a key + never icp\.runtimeId?; }; type Module record { diff --git a/ballerina/root_logger.bal b/ballerina/root_logger.bal index 31b05481..1b919213 100644 --- a/ballerina/root_logger.bal +++ b/ballerina/root_logger.bal @@ -148,9 +148,9 @@ isolated class RootLogger { } } if observe:isObservabilityEnabled() { - string? runtimeId = observe:getTagValue("icp.runtime"); + string? runtimeId = observe:getTagValue("icp.runtimeId"); if runtimeId is string { - logRecord["icp.runtime"] = runtimeId; + logRecord["icp.runtimeId"] = runtimeId; } } diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 37ca848d..3def50e3 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -7,7 +7,7 @@ keywords = ["level", "format"] repository = "https://github.com/ballerina-platform/module-ballerina-log" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.12.0" +distribution = "2201.13.0" [platform.java21] graalvmCompatible = true From 8d5d0a1aa87efe7121469d74289c5b2ed212c7ac Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Wed, 26 Nov 2025 14:22:11 +0530 Subject: [PATCH 11/11] Address review suggestions --- ballerina/root_logger.bal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ballerina/root_logger.bal b/ballerina/root_logger.bal index 1b919213..b8b6d195 100644 --- a/ballerina/root_logger.bal +++ b/ballerina/root_logger.bal @@ -39,6 +39,8 @@ type ConfigInternal record {| boolean enableSensitiveDataMasking = enableSensitiveDataMasking; |}; +final string ICP_RUNTIME_ID_KEY = "icp.runtimeId"; + final RootLogger rootLogger; # Get the root logger instance. @@ -148,9 +150,9 @@ isolated class RootLogger { } } if observe:isObservabilityEnabled() { - string? runtimeId = observe:getTagValue("icp.runtimeId"); + string? runtimeId = observe:getTagValue(ICP_RUNTIME_ID_KEY); if runtimeId is string { - logRecord["icp.runtimeId"] = runtimeId; + logRecord[ICP_RUNTIME_ID_KEY] = runtimeId; } }