xorm.NewSyslogLogger doesn't work #353
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#353
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello.
Problem: xorm syslogging doesn't write to system journal. All log messages still spam to console terminal.
Snippet:
Sources: github.com/corvinusy/rest-xorm-example
Testing environment:
Arch Linux: rolling
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
uname -rm: 4.4.1-2-ARCH x86_64
go version: go version go1.6rc2 linux/amd64
xorm SQL backend: xorm.NewEngine("sqlite3", "/tmp/rest-xorm.sqlite.db")
I will check this issue.
Please use
engine.SetLogger(logger)
instead ofengine.Logger = logger
And I will changeengine.Logger
toengine.logger
in next release.At this moment
breaks build with error:
//// cannot use logWriter (type *syslog.Writer) as type core.ILogger in argument to s.engine.SetLogger: *syslog.Writer does not implement core.ILogger (wrong type for Debug method) have Debug(string) error want Debug(...interface {}) error
I mean
@corvinusy
OKay. I found that's my wrong. Just fix it. Please check again. @corvinusy
Build fixed. Log gone from terminal.
But I still haven't found xorm log messages in journal (only "hello")
May be I should look in deeper.
Yes, I just found it.
I found if I changed
to
The log will be ok. But I don't know the reason.
@corvinusy
Hey, @lunny
I've updated my example github.com/corvinusy/rest-xorm-example so logging to syslog works fine.
It seems there is no necessity for exported 'SyslogLogger' any more.
And perhaps it should be properly documented.
Yes, I think you are right.
SyslogLogger
will be deprecated.So I think the issue has been solved.
Of course, you can use any part of mentioned example for your goals/docs.
Thanks.