Commit Graph

46 Commits

Author SHA1 Message Date
Derek Collison
f0cdf89c61 JetStream Clustering WIP
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 01:14:52 -08:00
Ivan Kozlovic
c27f717ef6 [FIXED] Log file size limit not honored after re-open signal
When the logfile_size_limit option is specified, the logfile will
be automatically rotated. However, if user still sends the re-open
signal (SIGUSR1), the log file will then no longer apply the
size limit.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-06-01 09:17:32 -06:00
Matthias Hanel
f5bd07b36c [FIXED] trace/debug/sys_log reload will affect existing clients
Fixed #1296, by altering client state on reload

Detect a trace level change on reload and update all clients.
To avoid data races, read client.trace while holding the lock,
pass the value into functionis that trace while not holding the lock.
Delete unused client.debug.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 13:54:15 -05:00
Ivan Kozlovic
34e4c64e50 Merge pull request #1295 from nats-io/sys-trace
Adding option to enable tracing the system account. (default: false)
2020-03-02 16:48:55 -07:00
Matthias Hanel
6bd6757ca5 Renamed traceSystemAcc to traceSysAcc
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 14:32:42 -05:00
Matthias Hanel
5fa9b654ce changing sys_trace to trace_verbose, adding -VV and -DVV flags
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 14:27:58 -05:00
Matthias Hanel
bf952a3807 Adding option to enable tracing the system account. (default: false)
Use sys_trace option in config file or --sys_trace on the command line

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-01 19:42:40 -05:00
Matthias Hanel
c18a5a2582 Fixing typos, copyright date and changed type in log.go/Error func
added comment and changed type Error(c,sc)

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-24 19:37:25 -05:00
Matthias Hanel
d1d34d2638 Suggestion to improve tracing in nats-server through wrapping errors
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-24 16:00:46 -05:00
Ivan Kozlovic
e9a134ac48 [ADDED] LogSizeLimit option
Allow auto-rotation of log files when the size is greater than
configured limit.
The backup files have the same name than the original log file
name with the following suffix:

<log name>.yyyy.mm.dd.hh.mm.ss.micros

where:
- yyyy   is the year
- mm     is the month
- dd     is the day
- hh     is the hour
- mm     is the minute
- ss     is the second
- micros is the number of microseconds (to help avoid duplicates)

Resolves #1197

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-21 15:26:33 -07:00
Ivan Kozlovic
ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison
acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison
ea5a6d9589 Updates for comments, some golint fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-10-31 20:28:44 -07:00
Derek Collison
47963303f8 First pass at new cluster design
Signed-off-by: Derek Collison <derek@nats.io>
2018-10-24 21:29:29 -07:00
Waldemar Quevedo
5e3950df0a Add Warnf to logger interface
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-09-10 14:50:48 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Colin Sullivan
920cdddfc8 Change log level to error 2018-03-14 10:29:44 -06:00
Colin Sullivan
bc59ad6ba7 Fix capitalization in log statement 2018-03-13 19:12:41 -06:00
Colin Sullivan
508ce2bcf3 implement io.Closer interface in the logger 2018-03-13 19:08:45 -06:00
Colin Sullivan
182be3feb9 Close files on reload. 2018-03-13 15:31:45 -06:00
Tyler Treat
54e23a3989 Enable syslog when running as Windows service
This writes logs to the Windows event log.
2017-06-28 14:16:26 -05:00
Tyler Treat
4f28bf7630 Remove use of getOpts() in log.go 2017-06-06 08:51:34 -05:00
Tyler Treat
cc30af8ede Address code review feedback 2017-06-05 17:43:42 -05:00
Tyler Treat
c468abd15f Merge branch 'master' of github.com:nats-io/gnatsd into config_reload 2017-06-05 13:41:04 -05:00
Tyler Treat
28160f1de2 Remove global logger
gnatsd currently uses a global logger. This can cause some problems
(especially around the config-reload work), but global variables are
also just an anti-pattern in general. The current behavior is
particularly surprising because the global logger is configured through
calls to the Server.

This addresses issue #500 by removing the global logger and making it a
field on Server.
2017-05-31 16:06:31 -05:00
Tyler Treat
43ee0ce6df Fix unit tests 2017-05-31 12:52:20 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Derek Collison
f7ba3d175e Correct invocation of misspell with fixes 2017-04-21 09:21:33 -07:00
Derek Collison
1c32f28934 Support to reopen file based logs for rotation 2016-11-21 21:55:24 -08:00
Ivan Kozlovic
9f758bbd0d Use simple if/else 2016-10-06 09:30:49 -06:00
Ivan Kozlovic
44d18c3af6 [FIXED] SetLogger to be able set debug/trace to 0
In NATS Streaming, we have a test - started early on - that was testing
logging and called SetLogger(l, true, true), then reset by calling
SetLogger(l, false, false) to reset the values. That obviously had not
the expected effect.
During profiling, I noticed that there were tons of allocated
objects due to NATS server debug/trace statements caused by that.
2016-10-05 17:56:25 -06:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Derek Collison
d9c7392c4d race fixes, tests 2015-06-16 12:48:50 -07:00
Derek Collison
eaf20c2667 minor updates 2015-01-09 18:46:31 -08:00
Máximo Cuadros Ortiz
65ae9c16f2 extendable auth methods 2014-11-27 00:26:13 +01:00
Ken Robertson
5623b583a9 Updates for new logging to appease govet
Govet doesn't like functions that look like format handlers not ending in `f`,
such as Debug() vs Debugf(). This is changing some of the new log handling to
use 'f' function names to appease govet.

Updated the implicit handling of including the client as an arg without being
used in a format string. Now the client object simply has a Errorf function
for logging errors and it adds itself onto the format string.
2014-10-29 11:32:14 -07:00
Máximo Cuadros Ortiz
7c7578ae38 Notice and Logger messages 2014-10-16 01:16:21 +02:00
Máximo Cuadros Ortiz
6586ac4653 better client identification at logs and some performances improves 2014-10-16 00:44:56 +02:00
Máximo Cuadros Ortiz
96d044dce4 login system abstraction 2014-10-16 00:44:22 +02:00
Derek Collison
d21e2caf8c golint updates 2013-10-13 09:52:51 -07:00
Derek Collison
cf0f30200f log file support, data race fixes 2013-08-02 16:52:54 -07:00
Derek Collison
33fdc5274d Fixed data races 2013-06-12 00:12:52 -07:00
Brady Catherman
2b856275c4 Allow enabling and disabling of logging. 2012-12-11 15:54:58 -08:00
Derek Collison
0d9d4f6aa1 Syntax changes 2012-12-06 12:05:22 -08:00
Derek Collison
2968ea1538 auth support, cleanup 2012-12-05 16:59:48 -08:00
Derek Collison
c3eba76367 Added base logging/tracing 2012-11-13 11:26:53 -08:00