Logjam no longer logs ...
oubiwann opened this issue · comments
Something's wrong with the more recent builds; no errors, but also no logging ...
I suspect that the configuration isn't getting set properly for lager ... cause in point:
lfe> (lager:log 'error (self) "test" '())
ok
No output ...
Starting the LFE REPL in the logjam project with -s lager -s logjam
works:
Erlang/OTP 21 [erts-10.3.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace]
..-~.~_~---..
( \\ ) | A Lisp-2+ on the Erlang VM
|`-.._/_\\_.-': | Type (help) for usage info.
| g |_ \ |
| n | | | Docs: http://docs.lfe.io/
| a / / | Source: http://github.com/rvirding/lfe
\ l |_/ |
\ r / | LFE v1.3-dev (abort with ^G)
`-E___.-'
lfe> 11:53:06.179 [info] Starting logjam ...
(logjam-util:check)
11:53:13.371 [info] logjam-util:check/0 Checking all log levels ...
11:53:13.371 [info] logjam-util:check/0 Testing log output of info with args: apple, banana, and cranberry ...
11:53:13.371 [notice] logjam-util:check/0 Testing log output of notice with args: apple, banana, and cranberry ...
11:53:13.371 [warning] logjam-util:check/0 Testing log output of warning with args: apple, banana, and cranberry ...
11:53:13.371 [error] logjam-util:check/0 Testing log output of error with args: apple, banana, and cranberry ...
11:53:13.371 [critical] logjam-util:check/0 Testing log output of critical with args: apple, banana, and cranberry ...
11:53:13.371 [alert] logjam-util:check/0 Testing log output of alert with args: apple, banana, and cranberry ...
11:53:13.371 [emergency] logjam-util:check/0 Testing log output of emergency with args: apple, banana, and cranberry ...
11:53:13.371 [info] logjam-util:check/0 Check complete.
As such, it seems that the app startup process we'd been using with earlier versions of Erlang and LFE no longer work as expected ...
Note, however, that the log output is not coloured ...
Looks like the change in behaviour that so badly affected logjam, was made in the 2.x to 3.x updates in the lager project. Downgrading to v2.2.3 of lager fixes all of this.
Ugh; rolling back to 2.2.3 only fixed it for older Erlangs, e.g., the 17.5 release I was testing on. Testing with 21.3 shows the following exception:
=CRASH REPORT==== 19-May-2019::20:15:19.181683 ===
crasher:
initial call: lager_handler_watcher:init/1
pid: <0.112.0>
registered_name: []
exception exit: noproc
in function gen:do_for_proc/2 (gen.erl, line 228)
in call from gen_event:rpc/2 (gen_event.erl, line 239)
in call from lager_handler_watcher:install_handler/3 (/Users/dmcgreggor/lab/lfe/logjam/_build/default/lib/lager/src/lager_handler_watcher.erl, line 92)
in call from lager_handler_watcher:init/1 (/Users/dmcgreggor/lab/lfe/logjam/_build/default/lib/lager/src/lager_handler_watcher.erl, line 51)
in call from gen_server:init_it/2 (gen_server.erl, line 374)
in call from gen_server:init_it/6 (gen_server.erl, line 342)
ancestors: [lager_handler_watcher_sup,lager_sup,<0.97.0>]
message_queue_len: 0
messages: []
links: [<0.100.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 257
neighbours:
As I have mentioned in other tickets (so I will repeat here):
- The fix for Erlang 17.5 through 20.3 is use Lager 2.2.3
- The fix for Erlang 21.3+ will be to use the logjam wrapper around the Erlang logger module
For the latter, be sure to check out ticket #10 :-)
Closing this as "addressed with workaround."