Documentation ¶
Index ¶
- func AuditLn(correlationId *string, v ...any)
- func CreateLogServer() *grpc.Server
- func DebugLn(correlationId *string, v ...any)
- func ErrorLn(correlationId *string, v ...any)
- func FatalLn(correlationId *string, v ...any)
- func InfoLn(correlationId *string, v ...any)
- func SentinelLoggerUrl() string
- func TraceLn(correlationId *string, v ...any)
- func WarnLn(correlationId *string, v ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditLn ¶
AuditLn logs an audit message with the provided correlationId and message arguments. Audit messages are always logged, regardless of the current log level.
func CreateLogServer ¶
CreateLogServer initializes and starts a gRPC server for logging services. It sets up a TCP listener on the address specified by SentinelLoggerUrl, registers the LogServiceServer, and starts serving incoming connections.
Returns:
- A pointer to the initialized grpc.Server if the server starts successfully.
- Nil if there is an error in creating the listener or starting the server.
Errors:
- If it fails to create the TCP listener, it logs the error and returns nil.
- If the server fails to start serving, it logs the error but still returns the server instance, which might not be in a fully operational state.
Usage:
server := logger.CreateLogServer() if server == nil { fmt.Println("Failed to start log server") } else { fmt.Println("Log server started successfully") }
func DebugLn ¶
DebugLn logs a debug message with the provided correlationId and message arguments if the current log level is Debug or lower.
func ErrorLn ¶
ErrorLn logs an error message with the provided correlationId and message arguments if the current log level is Error or lower.
func FatalLn ¶
FatalLn logs a fatal message with the provided correlationId and message arguments. The application will exit after the message is logged.
func InfoLn ¶
InfoLn logs an informational message with the provided correlationId and message arguments if the current log level is Info or lower.
func SentinelLoggerUrl ¶
func SentinelLoggerUrl() string
SentinelLoggerUrl retrieves the URL for the VSecM Sentinel Logger from the environment variable VSECM_SENTINEL_LOGGER_URL. If this environment variable is not set, it defaults to "localhost:50051".
This url is used to configure gRPC logging service, which enables VSecM Sentinel's `safe` CLI command to send audit logs to the container's standard output.
Types ¶
This section is empty.