|
@@ -49,11 +49,11 @@ func NewLogger() (*Logger, error) {
|
|
|
func (l *Logger) LogAuth(r *http.Request, loginStatus bool) error {
|
|
|
username, _ := mv(r, "username", true)
|
|
|
timestamp := time.Now().Unix()
|
|
|
- return l.LogAuthByUsername(username, r.RemoteAddr, timestamp, loginStatus, "web")
|
|
|
+ return l.LogAuthByRequestInfo(username, r.RemoteAddr, timestamp, loginStatus, "web")
|
|
|
}
|
|
|
|
|
|
//Log the current authentication to record by custom filled information. Use LogAuth if your module is authenticating via web interface
|
|
|
-func (l *Logger) LogAuthByUsername(username string, remoteAddr string, timestamp int64, loginSuceed bool, authType string) error {
|
|
|
+func (l *Logger) LogAuthByRequestInfo(username string, remoteAddr string, timestamp int64, loginSuceed bool, authType string) error {
|
|
|
//Get the current month as the table name, create table if not exists
|
|
|
current := time.Now().UTC()
|
|
|
tableName := current.Format("Jan-2006")
|