# Logging

**URL:** <https://forum.kx.com/t/logging/9101>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [September 29, 2014, 6:42am UTC](https://forum.kx.com/t/logging/9101 "2014-09-29T06:42:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharani\_sub](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bharani\_sub](https://forum.kx.com/u/bharani_sub)\
**Post date:** [September 29, 2014, 6:42am UTC](https://forum.kx.com/t/logging/9101/1 "2014-09-29T06:42:00Z")

</div>

Hi,

I am trying to understand the logging functionality but a simple example from the cookbook doesn’t seem to work.

In the server

q test -l&nbsp;

t:(name:();age:())

\p 6000

In the client

h: hopen `:localhost:6000

h"`t insert (`one;1)"

I can see the rows in the server and the test.log is created. But once i quit the server and start again with

q test -l&nbsp;

it throws&nbsp;

'type and quits the process

I am using 3.2 version of 32bit on OS x. I can’t figure out what is wrong with my setup

Thanks

Bharani

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [September 29, 2014, 8:41am UTC](https://forum.kx.com/t/logging/9101/2 "2014-09-29T08:41:00Z")

</div>

you can see what is in the logfile

q)get`:test.log

“`t insert (`one;1)”

it is missing your definition for t.

To force local commands to be logged, you need to execute them through a handle. Using localhandle 0

q)0"t:(name:();age:())"

or better, put your init q code in test.q, which is loaded before playing back test.log
