_this.logger.warning is not a function
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Browser:
- Chrome version 74.0.3729.157
- Firefox version 66.0.5
- IE version XX
- Edge version XX
- Safari version XX
Library version
Library version: 1.0.1 (latest at this date of 24.5.19)
## Current behavior
I added logging as per https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-logging to end up with:
```
logger: {
localCallback: loggerCallback,
level: LogLevel.Verbose,
piiLoggingEnabled: true,
correlationId: '1234',
}
```
I saw this error in the browser console:
```
core.js:15724 ERROR Error: Uncaught (in promise): TypeError: _this.logger.warning is not a function
TypeError: _this.logger.warning is not a function
at UserAgentApplication.js:471
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17299)
```
I had to add ALL logger fields to remove this error and get the application working.
```
logger: {
localCallback: loggerCallback,
level: LogLevel.Verbose,
piiLoggingEnabled: true,
correlationId: '1234',
logMessage: loggerCallback,
executeCallback: loggerCallback,
errorPii: singleMessage,
error: singleMessage,
warning: singleMessage,
warningPii: singleMessage,
info: singleMessage,
infoPii: singleMessage,
verbose: singleMessage,
verbosePii: singleMessage
}
```
## Expected behavior
I would think that most of those fields are optional - they could default to an already given loggerCallback. Or the doco could be updated to say they need to be populated also.
I also added a comment to that https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-logging page to say it isn't showing all the fields of Logger (before I discovered the error).
## Minimal reproduction of the problem with instructions
Follow https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-logging
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
this.logger.warn and this.logger.verbose is not a function
I'm trying to add papertrail logging to nest. I am using nest-winston module to inject the logger in bootstrap: // logging.ts import ...
Read more >Winston logger.info is not a function - node.js
I've set up Winston with transports to MySQL and console and put it in a module called logger ...
Read more >How to use the winston.config function in winston
When called with logger.debug("message", args) it should // act like ... const obj = {}; // Create the log directory if it does...
Read more >nest-winston
One solution is to create the logger outside of the application lifecycle, using the createLogger function, and pass it to NestFactory.create .
Read more >Logging facility for Python — Python 3.11.1 documentation
This module defines functions and classes which implement a flexible event logging system for ... Note that the root logger is created with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Specifically I now have:
Is this working?