file ownership confusion

Hello all,
I have a script that runs on both the test and production box. The script is owned by a user (abcd for example) with permission set to 700. When this script is run as a root, the log file generated has owner and group as abcdowner and abcdgroup respectively.
Now, when I run the same script in production box as a root(with same script permission 700), I get the logfile with owner as a root and system as a group.
I need to have the ownership of the logfile exactly as the way it comes out in test box for my production box.

Here is my question? what is making the test box to produce the logfile with the mentioned owners whereas it is different for the production box.

Pls..do not say to change the ownership of the logfile from the script in the production box to make it like the test box because that will be the work around not a permanent solution.

thanks

The script owner and group have no relationship with the log file ones. Files created by a user belong to that user. Existing files might belong to someone else.

I guess the script was probably run by abcd once. Further execution by root using the same log file didn't change the log owner.

What are the permissions on the directory where the logfile is being written to?

permission on log file directory:
for prod environment: 700
for test environment: 750

Again, test environment produces output of the log file with ownership as: abcdowner:abcdgroup. and this is what I want for the prod environment as well.

Permissions shouldn't make any difference.

Double check you are really running as root on the test box and that the log file doesn't already exists.

Can you tell what OS and what filesystem you are using too ?