I’m having some trouble getting logging to work following the
instructions here: https://code.kx.com/trac/wiki/Cookbook/Logging.
For some reason, messages sent to the 0 handle doesn’t seem to get
written into the log, but messages sent from other processes do.
Here’s my test setup:
I am wondering why the insert from inside test3.q isn’t written to the
log. I wrote a C module which I am loading as a shared library to
read data into kdb. However, since I can’t seem to write to the log
from inside a kdb process, I am now wondering whether I will need to
rewrite the library into a separate process.
Hi,It is not the problem of the 0 handle, i think it is the way you startup the logging processq)h:hopen::5012;q)h0q)q abc -lq)\l test3.q,0q)\\copy abc.log showlog.logq showlog -l(ins;x;1 2)Regards,XiOn 20 April 2010 00:56, Victor Wong <victor.wong> wrote:> Hi,>> I'm having some trouble getting logging to work following the> instructions here: https://code.kx.com/trac/wiki/Cookbook/Logging.> For some reason, messages sent to the 0 handle doesn't seem to get> written into the log, but messages sent from other processes do.> Here's my test setup:>> test3.q:> \p 5012> ins:insert;> x:([]a:();b:());> 0(ins;x;(1;2))>> showlog.q:> .z.ps:{0N!x}>> command line:> q test3 -l> q> q)h:hopen::5012; h(ins;x;(3;4)); h(ins;x;(5;6));> q)\> copy test3.log showlog.log> q showlog -l> (ins;x;3 4)> (ins;x;5 6)>> I am wondering why the insert from inside test3.q isn’t written to the> log. ?I wrote a C module which I am loading as a shared library to> read data into kdb. ?However, since I can’t seem to write to the log> from inside a kdb process, I am now wondering whether I will need to> rewrite the library into a separate process.>> Thanks,> Victor>> –>
Thanks, Xi. You example works for me. However, when I attempt toapply it to my problem, I can’t seem to get it to work. I call a qfunction from my C shared library when data comes in (via a socketregistered with sd1()), and in that function, I make the call to the 0handle. Attaching a 0N! to .z.ps confims that this call is being madeand is successful. For some reason though, this doesn’t get writtento the log. I have tried this both by specifying the q script on thecommand line and by loading it via \l.Is there an explicit function to write to a log file, something of aninverse to -11! ?Thanks,VictorOn Apr 19, 5:21?pm, Xi Chen <heydic…> wrote:> Hi,>> It is not the problem of the 0 handle, i think it is the way you start> up the logging process> q)h:hopen::5012;> q)h> 0> q)>> q abc -l> q)\l test3.q> ,0> q)\\>> copy abc.log showlog.log> q showlog -l> (ins;x;1 2)>> Regards,> Xi>> On 20 April 2010 00:56, Victor Wong <victor.w...> wrote:>>>>>> > Hi,>> > I'm having some trouble getting logging to work following the> > instructions here:https://code.kx.com/trac/wiki/Cookbook/Logging.> > For some reason, messages sent to the 0 handle doesn't seem to get> > written into the log, but messages sent from other processes do.> > Here's my test setup:>> > test3.q:> > \p 5012> > ins:insert;> > x:([]a:();b:());> > 0(ins;x;(1;2))>> > showlog.q:> > .z.ps:{0N!x}>> > command line:> > q test3 -l> > q> > q)h:hopen::5012; h(ins;x;(3;4)); h(ins;x;(5;6));> > q)\> > copy test3.log showlog.log> > q showlog -l> > (ins;x;3 4)> > (ins;x;5 6)>> > I am wondering why the insert from inside test3.q isn’t written to the> > log. ?I wrote a C module which I am loading as a shared library to> > read data into kdb. ?However, since I can’t seem to write to the log> > from inside a kdb process, I am now wondering whether I will need to> > rewrite the library into a separate process.>> > Thanks,> > Victor>> > –> >