exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

request data have a mistake #63

Closed EthianWong closed 7 years ago

EthianWong commented 7 years ago

if i use this function

client.submitLog('app.logger', 'submitLog', 'Info')

the request info like this :

[
    {
        "date": "2016-11-09T14:26:39.742Z",
        "type": "log",
        "source": "app.logger",
        "message": "submitLog",
        "data": {
            "@level": "Info",
            "@environment": {
                "processor_count": 4,
                "total_physical_memory": 8485175296,
                "available_physical_memory": 4277342208,
                "command_line": "C:\\Program Files\\nodejs\\node.exe C:\\Users\\WangYunjian\\Desktop\\test\\app.js",
                "process_name": "",
                "process_id": "8564",
                "process_memory_size": 10505040,
                "architecture": "x64",
                "o_s_name": "Windows_NT",
                "o_s_version": "10.0.14393",
                "ip_address": "192.168.20.103",
                "machine_name": "DESKTOP-ABMNEVC",
                "runtime_version": "v4.6.1",
                "data": {
                    "loadavg": [
                        0,
                        0,
                        0
                    ],
                    "platform": "win32",
                    "tmpdir": "C:\\Users\\WANGYU~1\\AppData\\Local\\Temp",
                    "uptime": 8641.2762081,
                    "endianness": "LE"
                }
            }
        },
        "tags": []
    }
]

in dashboard qq 20161109223050

if i use this function

client.createLog('app.logger', 'createLog then submit', 'Info').submit()

result has change and process_name is unreadable chars

[
    {
        "date": "2016-11-09T14:27:48.224Z",
        "type": "log",
        "source": "app.logger",
        "message": "createLog then submit",
        "data": {
            "@level": "Info",
            "@environment": {
                "processor_count": 4,
                "total_physical_memory": 8485175296,
                "available_physical_memory": 4271304704,
                "command_line": "C:\\Program Files\\nodejs\\node.exe C:\\Users\\WangYunjian\\Desktop\\test\\app.js",
                "process_name": "��(5�\u0001",
                "process_id": "4612",
                "process_memory_size": 10505040,
                "architecture": "x64",
                "o_s_name": "Windows_NT",
                "o_s_version": "10.0.14393",
                "ip_address": "192.168.20.103",
                "machine_name": "DESKTOP-ABMNEVC",
                "runtime_version": "v4.6.1",
                "data": {
                    "loadavg": [
                        0,
                        0,
                        0
                    ],
                    "platform": "win32",
                    "tmpdir": "C:\\Users\\WANGYU~1\\AppData\\Local\\Temp",
                    "uptime": 8709.7455583,
                    "endianness": "LE"
                }
            }
        },
        "tags": []
    }
]

in dashboard

qq 20161109223101

i use windows 10 and language is chinese , file encoding is utf8

EthianWong commented 7 years ago

it's so odd...

process.title is different ....

qq 20161109223830

but if i create a js just console process.title the result is normal

EthianWong commented 7 years ago

i make a demo

var a = process.title;
console.log(process.title || "empty");
console.log(a);
console.log(a === process.title);

"process.title" and "a" is always different ...

i run

node app.js

in atom inner terminal will be always different ...

but if i use cmd run app.js result always is true

so maybe this problem from atom or atom terminal (but atom terminal always use cmd )

maybe you should change function to get process.title because many people use atom terminal....

or you can tell developer in development environment should set process.title in application....

then in exceptionless dashboard log always like good

EthianWong commented 7 years ago

I'm not good at English , so do you understand?

niemyjski commented 7 years ago

I think these two are related: https://github.com/exceptionless/Exceptionless.JavaScript/issues/62 It comes down to encoding of those fields I think.

Were you able to reproduce this in the master branch? https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/src/services/NodeEnvironmentInfoCollector.ts#L32

EthianWong commented 7 years ago

It's just will be happend in atom's terminal. If i use system's terminal this problem will be resolve.

so maybe this problem not about your project

but if you want to see this you should use atom and install this package https://atom.io/packages/platformio-ide-terminal for reproduce this problem

EthianWong commented 7 years ago

but i also seem #62

builder.setProperty("Response", res);

if res object has chinese value , exceptionless dashboard will not be normal.

EthianWong commented 7 years ago

62 I find this problem how to resolve , i will submit a pull request

niemyjski commented 7 years ago

I'm closing this as this is a duplicate of #62 which I'm working on in the browser and will take a look at your pr for node once it's fixed in the browser :)