diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 98490174..abc671fc 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,13 +1,13 @@ [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" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.12.0" +distribution = "2201.13.0" [platform.java21] graalvmCompatible = true @@ -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 040bfb8a..377fd97d 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.14.0" +version = "2.15.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.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] 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 01ae0551..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. @@ -147,6 +149,13 @@ isolated class RootLogger { logRecord[k] = v; } } + if observe:isObservabilityEnabled() { + string? runtimeId = observe:getTagValue(ICP_RUNTIME_ID_KEY); + if runtimeId is string { + logRecord[ICP_RUNTIME_ID_KEY] = runtimeId; + } + } + foreach [string, Value] [k, v] in self.keyValues.entries() { logRecord[k] = v is Valuer ? v() : (v is PrintableRawTemplate ? evaluateTemplate(v, self.enableSensitiveDataMasking) : v); 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 diff --git a/gradle.properties b/gradle.properties index 448b8c86..191952ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.stdlib -version=2.14.1-SNAPSHOT -ballerinaLangVersion=2201.12.0 +version=2.15.0-SNAPSHOT +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.5.0 -observeInternalVersion=1.5.0 +observeVersion=1.7.0 +observeInternalVersion=1.7.0 testngVersion=6.14.3