question

364321644 avatar image
364321644 asked

Game server log

I just write a exe to log what command lines parameters are. But I got nothing.

In this exe,first I tried use "log_file_path" as path with file name to write parameters.Then try to create a file in"output_files_directory_path".

1. Outputfiles is a empty zip file. Click log file just return 404. Is this mean I doesn't create the log file.

2. Does "log_file_path" have file name.

3. Can I get exit code for debug due to don't have log.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Log files that are written to the log_file_path (auto-generated by our service - and it's always a complete path) are always captured. If you're not seeing one, can you let me know the Title ID and Build ID, and is it okay if we start a build in your title to check the output (we'll log into the machine directly, to see what it's doing)? All EC2 billing is in whole-hour increments, to be clear. So if you're in our free tier plan, that'll eat one of your 20 free server hours.

11 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

364321644 avatar image 364321644 commented ·

It is alright.

title:ef15

build id:test

0 Likes 0 ·
wangying avatar image wangying commented ·

Sorry the server is uploaded on this account.I'm not sure can you find build just by title.

title:ef15

build id:test

0 Likes 0 ·
brendan avatar image brendan wangying commented ·

So, I started your build, waited for it to be running, did a matchmake call to get the instance running, and there was no log file being written to the log directory. Can you check that you are specifically using the log_file_path - exactly as it is passed in - when creating your log file?

0 Likes 0 ·
wangying avatar image wangying brendan commented ·

int main(int argc, char *argv[]) {

for (int i = 0; i < argc; i++) {

if (strstr(argv[i], "log_file_path") == NULL) continue;

const char *p = strchr(argv[i], '=');

if (p == NULL) continue;

auto path=std::string(p + 1);

FILE* f;

f = fopen(path.c_str(), "w+");

if (f) { for (int i = 0; i < argc; i++) {

fwrite(argv[i], sizeof(char), strlen(argv[i]), f);

fputc('\n', f);

}

fclose(f);

}

}

}

Here is the simplest code. Can you help me figure out whatis wrong with this code.

0 Likes 0 ·
Show more comments
wangying avatar image wangying commented ·

I didn't know that exe can not run on the host.Use static build make things work correctly.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.