Comment 1 for bug 1314576

Revision history for this message
Joe Wood (joew60) wrote :

Just in case anybody else wants local time in the current version, I've attached two files to provide this facility.

You must call init_dated_local() prior to calling log4c_init(), e.g.

    if (init_dated_local() || log4c_init()) {
        err(EXIT_FAILURE, "log4c_init() failed");
    }

Compile layout_type_dated_local.c as normal, e.g

   gcc -c layout_type_dated_local.c

Link along these lines

   gcc -o a.out <project_files> layout_type_dated_local.o -llib4c

Use via log4crc e.g.

     <appender name="stdout" type="stream" layout="dated_local"/>

That's it.