transactionlog

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 3 Imported by: 0

README

Transaction log package

This is a package for transaction logging.

Usage

Here is an example of how to use this package. Start with creating a package in internal/logging and add a file logging.go with the following content:

package logging

import translog "github.com/mariusfa/gofl/v2/logging/trans-log"

var TransLogger *translog.TransLogger

func SetupTransLogger(appName string) {
	TransLogger = translog.NewTransLogger(appName)
}

In the main.go file, you can use the logger like this:

package main

import (
	"<my-module>/internal/logging"

	"github.com/mariusfa/gofl/v2/config"
)

func main() {
	logging.SetupTransLogger("<my-module>")
	transLogger := logging.TransLogger

    // ... rest of the code
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransLogger

type TransLogger struct {
	// contains filtered or unexported fields
}
var TransLog TransLogger

func NewTransLogger

func NewTransLogger(appName string) *TransLogger

func (*TransLogger) GetRequestInfo added in v0.4.0

func (al *TransLogger) GetRequestInfo(requestId string, requestPath string)

func (*TransLogger) PostRequestInfo added in v0.4.0

func (al *TransLogger) PostRequestInfo(requestId string, requestPath string, requestBody string)

func (*TransLogger) RequestInfo added in v0.3.0

func (al *TransLogger) RequestInfo(requestId string, requestMethod string, requestPath string, requestBody string)

func (*TransLogger) ResponseInfo added in v0.3.0

func (al *TransLogger) ResponseInfo(requestId string, durationMs string, status int, responseBody string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL