top
(README.md)
## log
[![GoDoc](https://godoc.org/github.com/lunny/log?status.png)](https://godoc.org/github.com/lunny/log)

[简体中文](https://github.com/lunny/log/blob/master/README_CN.md)

# Installation

```
go get github.com/lunny/log
```

# Features

* Add color support for unix console
* Implemented dbwriter to save log to database
* Implemented FileWriter to save log to file by date or time.
* Location configuration

# Example

For Single File:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(f)
```

For Multiple Writer:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(io.MultiWriter(f, os.Stdout))
```

For log files by date or time:
```Go
w := log.NewFileWriter(log.FileOptions{
    ByType:log.ByDay,
    Dir:"./logs",
})
log.Std.SetOutput(w)
```

# About

This repo is an extension of Golang log.

# LICENSE

 BSD License
 [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)

Imported by 86 package(s)

  1. git.oschina.net/lunny/tango
  2. github.com/1851616111/go-http-routing-benchmark
  3. github.com/CloudyKit/go-http-routing-benchmark
  4. github.com/JessonChan/go-http-routing-benchmark
  5. github.com/JulienSchmidt/go-http-routing-benchmark
  6. github.com/Lao-liu/dbweb
  7. github.com/TheHippo/go-http-routing-benchmark
  8. github.com/Xuyuanp/go-http-routing-benchmark
  9. github.com/andrewarrow/goftp_context
  10. github.com/beauhoyt/go-http-routing-benchmark
  11. github.com/besser/go-http-routing-benchmark
  12. github.com/bfitzsimmons/go-http-routing-benchmark
  13. github.com/citysir/go-http-routing-benchmark
  14. github.com/cnphpbb/tango
  15. github.com/codeskyblue/dbweb
  16. github.com/dinever/go-http-routing-benchmark
  17. github.com/djinn/go-http-routing-benchmark
  18. github.com/dstroot/ftpd
  19. github.com/figoxu/ftp
  20. github.com/fuxiaohei/tango
  21. github.com/gin-gonic/go-http-routing-benchmark
  22. github.com/go-gas/go-web-framework-benchmark
  23. github.com/go-tango/social-auth
  24. github.com/go-tango/social-auth/example
  25. github.com/go-tango/wego/modules/auth
  26. github.com/go-tango/wego/modules/mailer
  27. github.com/go-tango/wego/modules/post
  28. github.com/go-tango/wego/routers/admin
  29. github.com/go-tango/wego/routers/attachment
  30. github.com/go-tango/wego/routers/auth
  31. github.com/go-tango/wego/routers/post
  32. github.com/go-tango/wego/setting
  33. github.com/go-xorm/dbweb
  34. github.com/gobook/bookserver/middlewares
  35. github.com/gobuild-old/build
  36. github.com/godaily/news
  37. github.com/goftp/ftpd
  38. github.com/goftp/server
  39. github.com/gofury/go-web-framework-benchmark
  40. github.com/gotokatsuya/go-http-routing-benchmark
  41. github.com/jbuberel/go-http-routing-benchmark
  42. github.com/joeybloggs/go-http-routing-benchmark
  43. github.com/julienschmidt/go-http-routing-benchmark
  44. github.com/l3pp4rd/go-http-routing-benchmark
  45. github.com/liu-rui/go-http-routing-benchmark
  46. github.com/liu-rui/go-web-framework-benchmark
  47. github.com/lunny/go-http-routing-benchmark
  48. github.com/lunny/nodb
  49. github.com/lunny/tango
  50. github.com/lunny/weixinpay
  51. github.com/mikespook/go-http-routing-benchmark
  52. github.com/nipeone/ftpserver
  53. github.com/parkghost/nodb
  54. github.com/pegasuskim/go-http-routing-benchmark
  55. github.com/phacops/server
  56. github.com/phillihq/tango
  57. github.com/pkieltyka/go-http-routing-benchmark
  58. github.com/qiangxue/go-http-routing-benchmark
  59. github.com/safeie/go-http-routing-benchmark
  60. github.com/shenshouer/fish/client
  61. github.com/shenshouer/fish/server
  62. github.com/shivakar/go-http-routing-benchmark
  63. github.com/smallnest/go-web-framework-benchmark
  64. github.com/stiletto/goftp-server
  65. github.com/sunisdown/go-http-routing-benchmark
  66. github.com/tango-contrib/session-nodb
  67. github.com/tango-contrib/session-redis
  68. github.com/tango-contrib/session-ssdb
  69. github.com/tango-contrib/websocket/example
  70. github.com/theckman/go-http-routing-benchmark
  71. github.com/ttthzy/ftpd
  72. github.com/ttthzy/wego/modules/auth
  73. github.com/ttthzy/wego/modules/mailer
  74. github.com/ttthzy/wego/modules/post
  75. github.com/ttthzy/wego/setting
  76. github.com/twanies/go-http-routing-benchmark
  77. github.com/wangbinxiang/dbweb
  78. github.com/wangbinxiang/tango
  79. github.com/wangbinxiang/wego/routers/admin
  80. github.com/wangbinxiang/wego/routers/attachment
  81. github.com/wangbinxiang/wego/routers/auth
  82. github.com/wangbinxiang/wego/routers/post
  83. github.com/wangbinxiang/wego/setting
  84. github.com/xormplus/nodb
  85. github.com/xormplus/tango
  86. github.com/yalay/ftpd

Imported only in test by 2 package(s)

  1. github.com/tango-contrib/counting
  2. github.com/tango-contrib/dispatch

Test imports 1 package(s)

  1. github.com/mattn/go-sqlite3