The supplied mmap appender handles the end of the file and prints the rest of the rendered_message at the start of the mmaped file, but instead prints the start of the message again. The append function should alter the pointer passed to memcpy to print the end of the message:
...
+ char *msg = a_event->evt_rendered_msg;
if (!minfo && !minfo->ptr)
return 0;
size = strlen(a_event->evt_rendered_msg);
available = ((char *)minfo->addr + minfo->length) - (char *)minfo->ptr;
if (size > available) {
- memcpy(minfo->ptr, a_event->evt_rendered_msg, available);
+ memcpy(minfo->ptr, msg, available);
minfo->ptr = minfo->addr;
size -= available;
+ msg = msg + available;
}
- memcpy(minfo->ptr, a_event->evt_rendered_msg, size);
+ memcpy(minfo->ptr, msg, size);
minfo->ptr = (char *)minfo->ptr + size;
return 0;
}
Fixed in CVS HEAD, thanks.
log4c-1.2.2 released.