2

I'm using Erlang and Chicagoboss. When I am connected to localhost, I can see the log in server console. Where I run sh init-dev.sh.But in production mode I guess project runs as a daemon. Does anyone know where I can see the logs written by the statement error_logger:info_msg/2.

error_logger:info_msg(" SomeVaraiable : - ", [SomeVaraiable]),
trex
  • 3,848
  • 4
  • 31
  • 54

2 Answers2

4

You can see them in log/console.log. Try:

tail -f log/console.og

Also, error_logger takes format string similar to io:format. To print your variable it is best to use:

error_logger:info_msg("SomeVaraiable = ~p.", [SomeVaraiable]),

Your version would cause "FORMAT ERROR". ~p formatter is like "pretty print" and you have to have one for each Variable in the list, that is second argument to info_msg. I also like displaying variables for debugging purpose in format:

Variable = actual_content_of_variable.

Because this way, I am able to copy them from logs and paste it to Erlang console to do some further investigation (it is mostly useful in development mode, though).

tkowal
  • 9,129
  • 1
  • 27
  • 51
1

error_logger is a part of sasl application. So you need to check your sys.config and find sasl settings there..

Odobenus Rosmarus
  • 5,870
  • 2
  • 18
  • 21
  • 1
    True, but CB uses lager, which logs also error_logger messages. Its configured in boss.config and by default it points to "log/console.log", so you don't have to worry about sasl settings. – tkowal Sep 11 '14 at 12:44