Both programs will have the file open for append. If both programs write to them, there's no garantee you end up with something that isn't garbage...
On sane Unix-like systems, there is a guarantee: you won't get
garbage, regardless of the size of your writes.  If the log file is
opened in append mode and each entry is committed as a single write (system call),
Unix file semantics guarantee that the entries will be appended to the
file atomically. (For more information see Re^3: Looking for a simple multiprocess-enabled logging module, which quotes the relevant bits of the Single Unix
See also "All I want to do is append a small amount of text to the
end of a file. Do I still have to use locking?" from
 Provided that your log file resides on a filesystem
that supports Unix semantics. Network-mounted filesystems
often fall short.