Open BryantDavis1986 opened 2 weeks ago
Looking at the message in the screen shot, it appears that this isnt an issue with the context not being captured but the line parser not being able to parse the data. Here is more information https://docs.mezmo.com/docs/log-parsing
Looking at the message in the screen shot, it appears that this isnt an issue with the context not being captured but the line parser not being able to parse the data. Here is more information https://docs.mezmo.com/docs/log-parsing
yes it is a parsing error. i have tested removing the optional params, my additional context for user. it seems since i am not providing any additional meta data or context i still receive this error from the default context provided by the package.
Looking at the message in the screen shot, it appears that this isnt an issue with the context not being captured but the line parser not being able to parse the data. Here is more information https://docs.mezmo.com/docs/log-parsing
this was the context i was attempting to use:
i tried varying variable name from userName, userEmail etc they all seem to fail even though all the values are always strings. i attempted to follow the docs which show this: which shows the ability to add an object for user. but when i attempt to do so their is a type error from the package:
where the calues must be of type ContextT:
this is me logging my context object in logdna: in browser console:
the code doing the logging:
everything is consistently strings. so it is unclear to me the current issue with parsing.
no additional context provided by my app with the add context useEffect commented out:
If you look at the first screen shot, it appears that you are attempting to add the string "(app=Tradeweb-User-Interface, userEmail=cypress-buyer@alphaledger.com, env=ga, userName=Cypres Underwriter) "
to the meta.context
but meta.context
expects an object and there is unable to parse it.
The indexer will reset ever 24 hours or so but during that time the data types should not change. So if the first log that come through provides the meta.context
as an object then the rest of the lines should be the same or if meta.context
first got set as a string the every other time meta.context
should be a string until it resets.
If you look at the first screen shot, it appears that you are attempting to add the string
"(app=Tradeweb-User-Interface, userEmail=cypress-buyer@alphaledger.com, env=ga, userName=Cypres Underwriter) "
to themeta.context
butmeta.context
expects an object and there is unable to parse it. The indexer will reset ever 24 hours or so but during that time the data types should not change. So if the first log that come through provides themeta.context
as an object then the rest of the lines should be the same or ifmeta.context
first got set as a string the every other timemeta.context
should be a string until it resets.
so i have waited over 24hrs. saw the logs and the context work but then it stops. I am unsure how more consistent i can be with the context i am adding to always be strings. is the app wide issue? so if the issue is happening inconsistently with the types in dev, qa, beta, staging, production it would then break all the environments and wouldn't be fixed unless fixed in all the environments? because this is what i changed my code to locally:
useEffect(() => {
if (auth.user && auth.user.email && auth.user.name && auth.isAuthenticated && !auth.isLoading) {
logdna.clearContext();
const logDnaContext = {
env: `${CONFIG.env}`,
app: 'Tradeweb-User-Interface',
userName: `${auth.user.name}`,
userEmail: `${auth.user.email}`
}
logdna.addContext(logDnaContext);
console.log('logdna add context', logDnaContext);
} else {
logdna.clearContext();
const logDnaContext = {
env: `${CONFIG.env}`,
app: 'Tradeweb-User-Interface',
userName: `Not User`,
userEmail: `No User`
}
logdna.addContext(logDnaContext);
console.log('logdna add context', logDnaContext);
}
}, [auth.user, auth.isAuthenticated, auth.isAuthenticated])
If you look at the first screen shot, it appears that you are attempting to add the string
"(app=Tradeweb-User-Interface, userEmail=cypress-buyer@alphaledger.com, env=ga, userName=Cypres Underwriter) "
to themeta.context
butmeta.context
expects an object and there is unable to parse it. The indexer will reset ever 24 hours or so but during that time the data types should not change. So if the first log that come through provides themeta.context
as an object then the rest of the lines should be the same or ifmeta.context
first got set as a string the every other timemeta.context
should be a string until it resets.
i create a new key and app name for me to test this out but i am still running into issues. like this: i guess i am confused on how with a new key and app and the context being set is 100% always the same type which is strings. how the value types can be inconsistent
very first log with a new key, new hostname new app name:
I believe this index is for the entire account and not based on the specific key, host name or app name. I will double check this and let you know if that is incorrect.
Issue Report: LogDNA Browser Logging
Description
There is an issue with the logging mechanism in the LogDNA browser integration. The logs occasionally fail to capture the default context, including location, user information, environment, etc.
Example Log
LogDNA Initialization Code
Automatically Added Context (from documentation)
Expected Behavior
The logs should consistently capture the default context, including location, user information, environment, etc.