Need some guidance on the Logging liberary


(Beginner) #1

Hi All,

Looking on some guidance on the logging library which i can incorporate in my project.The requirements are

  • Logs can be directed to some file.
  • Logs should be rotated on daily basis.Name shall be configurable on the basis of date when it is rotated so that we could refer it easily.
  • Logs should be rotatable on the basis of size/number of lines of the log file.
  • It shall print the file or function name with date time apart from message we want to print.
  • Shall have logging level.

I tried using log4go “https://github.com/jeanphorn/log4go” and i am getting the messages but not really happy with the rotation part.point 2,4 are not working properly.

Regards,
Rajesh


(Gudjo) #2

i don’t know if i understood right but if i did if you didn’t tried https://github.com/sirupsen/logrus you can try it


(Alex Leonhardt) #3

also, whilst you’re looking at logs… this may be helpful https://godoc.org/github.com/kr/logfmt :slight_smile:


(Alex Leonhardt) #4

oh, logrus does logfmt format by default :wink: so yay