Skip to content

Commit 196a25e

Browse files
Merge branch 'hiero-ledger:main' into patch-1
2 parents b1a37d8 + ce72e27 commit 196a25e

File tree

4 files changed

+108
-23
lines changed

4 files changed

+108
-23
lines changed

block-node/app/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ val copyDockerFolder: TaskProvider<Copy> =
9090
into(dockerBuildRootDirectory)
9191
}
9292

93+
val copyDockerFolderCI: TaskProvider<Copy> =
94+
tasks.register<Copy>("copyDockerFolderCI") {
95+
description =
96+
"Copies the docker folder to the build root directory with CI specific files. To be used only in CI environments, for instance when running E2E tests."
97+
group = "docker"
98+
99+
dependsOn(copyDockerFolder)
100+
from(dockerBuildRootDirectory.file("ci-logging.properties"))
101+
into(dockerBuildRootDirectory)
102+
rename { f -> "logging.properties" }
103+
}
104+
93105
val createDockerImage: TaskProvider<Exec> =
94106
tasks.register<Exec>("createDockerImage") {
95107
description =
@@ -101,6 +113,17 @@ val createDockerImage: TaskProvider<Exec> =
101113
commandLine("sh", "-c", "./docker-build.sh ${project.version}")
102114
}
103115

116+
val createDockerImageCI: TaskProvider<Exec> =
117+
tasks.register<Exec>("createDockerImageCI") {
118+
description =
119+
"Creates the production docker image of the Block Node Server based on the current version, but with CI optimizations. Intended only for use in CI environments, like running E2E tests!"
120+
group = "docker"
121+
122+
dependsOn(copyDockerFolderCI, tasks.assemble)
123+
workingDir(dockerBuildRootDirectory)
124+
commandLine("sh", "-c", "./docker-build.sh ${project.version}")
125+
}
126+
104127
tasks.register<Exec>("startDockerContainer") {
105128
description =
106129
"Starts the docker production container of the Block Node Server for the current version"
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Log Level Values
3+
#
4+
# SEVERE: indicates a critical error or failure
5+
# WARNING: warns of potential issues or errors
6+
# INFO: reports normal operational information
7+
# CONFIG: provides configuration-related information
8+
# FINE: provides detailed debugging information
9+
# FINER: provides finer-grained debugging information
10+
# FINEST: provides the most detailed debugging information
11+
12+
# Set the default logging level
13+
# Available Levels are (from most verbose to least verbose):
14+
# ALL FINEST FINER FINE CONFIG INFO WARNING SEVERE OFF
15+
.level=INFO
16+
# logs for Block Node components FINEST temporarily
17+
org.hiero.block.level=FINEST
18+
# Helidon loggers
19+
io.helidon.level=INFO
20+
io.helidon.webserver.level=INFO
21+
io.helidon.config.level=SEVERE
22+
io.helidon.security.level=INFO
23+
io.helidon.common.level=INFO
24+
# Override the chatty HTTP server internals
25+
com.sun.net.httpserver.level = WARNING
26+
com.sun.net.httpserver.ServerImpl.level = WARNING
27+
com.sun.net.httpserver.ExchangeImpl.level = WARNING
28+
29+
# Configure the app log level
30+
#org.hiero.block.level=FINE
31+
#org.hiero.block.server.level=FINE
32+
33+
# Configure the configuration logging - OFF will suppress all configuration logging
34+
#org.hiero.block.server.config.logging.ConfigurationLoggingImpl.level=OFF
35+
36+
# Configure specific Block Node loggers
37+
#org.hiero.block.server.producer.ProducerBlockItemObserver.level=FINE
38+
#org.hiero.block.server.mediator.LiveStreamMediatorImpl.level=FINE
39+
#org.hiero.block.server.mediator.LiveStreamPoller.level=FINE
40+
#org.hiero.block.server.consumer.level=FINE
41+
#org.hiero.block.server.pbj.PbjBlockStreamServiceProxy.level=FINE
42+
43+
# Configure specific Block Node Consumer loggers
44+
#org.hiero.block.server.consumer.ConsumerStreamResponseObserver.level=FINE
45+
#org.hiero.block.server.consumer.HistoricBlockStreamSupplier.level=FINE
46+
47+
# Configure specific stream service loggers
48+
#org.hiero.block.server.pbj.PbjBlockStreamServiceProxy.level=FINE
49+
#org.hiero.block.server.persistence.StreamPersistenceHandlerImpl.level=FINE
50+
#org.hiero.block.server.persistence.storage.write.level=FINE
51+
#org.hiero.block.server.persistence.storage.archive.LocalGroupZipArchiveTask.level=FINE
52+
53+
# Helidon PBJ Plugin loggers
54+
#org.hiero.pbj.grpc.helidon.PbjProtocolHandler.level=FINE
55+
56+
################################################################################
57+
# Handlers configuration
58+
################################################################################
59+
handlers = java.util.logging.ConsoleHandler
60+
61+
################################################################################
62+
# ConsoleHandler configuration
63+
################################################################################
64+
java.util.logging.ConsoleHandler.level = ALL
65+
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
66+
67+
################################################################################
68+
# SimpleFormatter single-line format configuration
69+
################################################################################
70+
# The format syntax uses java.util.Formatter.
71+
# The parameters are:
72+
# %1$ - date/time (java.util.Date)
73+
# %2$ - source (usually class and method)
74+
# %3$ - logger name
75+
# %4$ - log level
76+
# %5$ - log message
77+
# %6$ - throwable trace
78+
#
79+
# Example to produce a line such as:
80+
# 2025-02-25 21:07:36.281+0000 INFO [org.hiero.block.server.Server main] Starting BlockNode Server
81+
# 21:07:36.281+0000 - Indicates UTC time since there's no offset
82+
# Log level is padded to 7 chars
83+
java.util.logging.SimpleFormatter.format = %TF %<TT.%<TL%<Tz %4$-7s [%2$s] %5$s%6$s%n

tools-and-tests/suites/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tasks.register<Test>("runSuites") {
3030

3131
// @todo(#813) All of the docker processing belongs here, not in block-node-app.
3232
// This might mean duplication, which is perfectly fine.
33-
dependsOn(":block-node-app:createDockerImage")
33+
dependsOn(":block-node-app:createDockerImageCI")
3434

3535
useJUnitPlatform() { excludeTags("api") }
3636
testLogging { events("passed", "skipped", "failed") }

tools-and-tests/suites/src/main/resources/logging.properties

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
32
# Log Level Values
43
#
54
# SEVERE: indicates a critical error or failure
@@ -57,34 +56,14 @@ com.sun.net.httpserver.ExchangeImpl.level = WARNING
5756
################################################################################
5857
# Handlers configuration
5958
################################################################################
60-
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
59+
handlers = java.util.logging.ConsoleHandler
6160

6261
################################################################################
6362
# ConsoleHandler configuration
6463
################################################################################
6564
java.util.logging.ConsoleHandler.level = ALL
6665
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
6766

68-
################################################################################
69-
# FileHandler properties
70-
################################################################################
71-
# The pattern for the output file name.
72-
java.util.logging.FileHandler.pattern = /opt/hiero/block-node/logs/blocknode-%g.log
73-
# Set append to true if you want to keep appending to existing files
74-
java.util.logging.FileHandler.append = true
75-
# The limit in bytes before a new file is started.
76-
# e.g., 5,000,000 bytes ~= 5MB
77-
java.util.logging.FileHandler.limit = 5_000_000
78-
# Number of log files to cycle through.
79-
# If count is 5, you end up with:
80-
# myapp-0.log ... myapp-4.log
81-
# Then it cycles back over the oldest.
82-
java.util.logging.FileHandler.count = 5
83-
# Log level for the FileHandler
84-
java.util.logging.FileHandler.level = ALL
85-
# Use your SimpleFormatter, or a custom format
86-
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
87-
8867
################################################################################
8968
# SimpleFormatter single-line format configuration
9069
################################################################################

0 commit comments

Comments
 (0)