Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syslog module doesn't recover after an error #21

Open
lego12239 opened this issue Nov 17, 2015 · 0 comments
Open

syslog module doesn't recover after an error #21

lego12239 opened this issue Nov 17, 2015 · 0 comments

Comments

@lego12239
Copy link

Hi.

If i send a one bad message(in my case unicode string instead of utf8 string), then all messages after that get me a "bad argument" error despite the fact that they are correct:

15> {ok, Logh} = syslog:open("test", [pid], local1).
{ok,#Port<0.1838>}
16> syslog:log(Logh, info, "ascii message").        
ok
17> syslog:log(Logh, info, <<"ascii message">>).
ok
18> syslog:log(Logh, info, unicode:characters_to_binary("utf8 сообщение")).
ok
19> syslog:log(Logh, info, "utf8 сообщение").                              

=ERROR REPORT==== 17-Nov-2015::11:25:21 ===
Bad value on output port 'syslog_drv'

** exception error: bad argument
     in function  port_command/2
        called as port_command(#Port<0.1838>,
                               [<<0,0,0,6>>,
                                [117,116,102,56,32,1089,1086,1086,1073,1097,1077,1085,1080,
                                 1077],
                                <<0>>])
     in call from syslog:log/3 (src/syslog.erl, line 127)
20> syslog:log(Logh, info, unicode:characters_to_binary("utf8 сообщение")).
** exception error: bad argument
     in function  port_command/2
        called as port_command(#Port<0.1838>,
                               [<<0,0,0,6>>,
                                <<117,116,102,56,32,209,129,208,190,208,190,208,177,209,
                                  137,208,181,208,189,208,184,208,181>>,
                                <<0>>])
     in call from syslog:log/3 (src/syslog.erl, line 127)
21> syslog:log(Logh, info, <<"ascii message">>).                           
** exception error: bad argument
     in function  port_command/2
        called as port_command(#Port<0.1838>,[<<0,0,0,6>>,<<"ascii message">>,<<0>>])
     in call from syslog:log/3 (src/syslog.erl, line 127)
22> syslog:log(Logh, info, "ascii message").                               
** exception error: bad argument
     in function  port_command/2
        called as port_command(#Port<0.1838>,[<<0,0,0,6>>,"ascii message",<<0>>])
     in call from syslog:log/3 (src/syslog.erl, line 127)

Can syslog module automatically recover in this situation? It would be great if syslog module keeps
a working state despite a one bad message.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant