logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Collection *mongo.Collection

Collection here that we manage Logs db

View Source
var Connect bool

Connect if db connected or not

DB poiner to mongoDB and can access from any where

Functions

func OpenConnection

func OpenConnection()

OpenConnection function for open connection with mongodb once

func SetSysLog

func SetSysLog(log SystemLog)

SetSysLog set the middleware logs here

func SetUserLog

func SetUserLog(log UserLog)

SetUserLog set the middleware logs here

Types

type Log

type Log struct {
	Event       string
	Description string
}

Log structure of the system base struct

type SystemLog

type SystemLog struct {
	Time time.Time
	Pkg  string
	Log  Log
}

SystemLog that extend from base Log and for System failure and logs

type UserLog

type UserLog struct {
	Log        Log
	IP         string
	RequestURL string
	Time       time.Time
}

UserLog that extend Log and for the api logs

Jump to

Keyboard shortcuts

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