initial
This commit is contained in:
16
tools/relp_log_trial.go
Normal file
16
tools/relp_log_trial.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
_ "git.eeqj.de/sneak/go-simplelog" // Using underscore to only invoke init()
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Send some test messages with structured data
|
||||
slog.Info("Starting the application", slog.String("status", "initialized"))
|
||||
slog.Info("Attempting to connect to database", slog.String("host", "localhost"), slog.Int("port", 5432))
|
||||
slog.Warn("Using default configuration", slog.String("configuration", "default"))
|
||||
slog.Error("Failed to load module", slog.String("module", "finance"), slog.String("error", "module not found"))
|
||||
slog.Info("Shutting down the application", slog.String("status", "stopped"))
|
||||
}
|
||||
8
tools/run_relp_log_trial.sh
Executable file
8
tools/run_relp_log_trial.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the environment variables for the RELP server URL and optionally for the webhook URL
|
||||
export LOGGER_RELP_URL="tcp://10.201.1.18:20514"
|
||||
export LOGGER_WEBHOOK_URL="https://example.com/webhook"
|
||||
|
||||
# Run the Go program
|
||||
go run relp_log_trial.go
|
||||
Reference in New Issue
Block a user