Add log4j2-levels module: threshold rule, inheritance, additivity, custom levels, Actuator runtime changes and argument evaluation on Spring Boot 4.1.2 / Log4j2 2.25.5, with real transcripts
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5SFkZoaMCukJNvZCV
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
fe3fc689a6
commit
c9a2b766bb
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Shared helpers for the live scripts. Source this, do not run it.
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
JAR=target/log4j2-levels-1.0.0.jar
|
||||
PID=""
|
||||
|
||||
start_app() { # start_app <port> <logfile> [spring args...]
|
||||
local port=$1 log=$2; shift 2
|
||||
setsid nohup java -jar "$JAR" --server.port="$port" "$@" > "$log" 2>&1 < /dev/null &
|
||||
PID=$!
|
||||
for _ in $(seq 1 60); do
|
||||
curl -s --noproxy '*' -o /dev/null "localhost:$port/actuator/health" && return 0
|
||||
kill -0 "$PID" 2>/dev/null || return 1
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
stop_app() {
|
||||
[ -n "$PID" ] && kill "$PID" 2>/dev/null && wait "$PID" 2>/dev/null
|
||||
PID=""
|
||||
}
|
||||
|
||||
# Print the console lines written since the last call (our pattern has no timestamp).
|
||||
new_lines() { # new_lines <logfile>
|
||||
local log=$1 seen=${SEEN:-0} total
|
||||
total=$(wc -l < "$log")
|
||||
tail -n +"$((seen + 1))" "$log"
|
||||
SEEN=$total
|
||||
}
|
||||
|
||||
http() { # http <method> <port> <path> [json body] -> "status body"
|
||||
local method=$1 port=$2 path=$3 body=${4:-}
|
||||
if [ -n "$body" ]; then
|
||||
curl -s --noproxy '*' -X "$method" -H 'Content-Type: application/json' -d "$body" -w ' [HTTP %{http_code}]' "localhost:$port$path"
|
||||
else
|
||||
curl -s --noproxy '*' -X "$method" -w ' [HTTP %{http_code}]' "localhost:$port$path"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user