ritzlgrmft / ionic-logging-service Goto Github PK
View Code? Open in Web Editor NEWThis service encapsulates log4javascript's functionalities for apps built with Ionic framework.
This service encapsulates log4javascript's functionalities for apps built with Ionic framework.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
package.json
file.A package.json file at the root of your project is required to release on npm.
Please follow the npm guideline to create a valid package.json
file.
Good luck with your project β¨
Your semantic-release bot π¦π
Hi,
first of all, thank you for your hard work. I followed your tutorial and got stuck at this point. Basically I want the user to choose the threshold via GUI. So I adapted the configureLogging method like so:
export function configureLogging(loggingService: LoggingService, config:LoggingServiceConfiguration): () => void {
return () => loggingService.configure(config);
}
When I call configureLogging what would you suggest to fill in as a parameter for the loggingService?
I am fairly new to TypeScript and this is maybe a more TypeScript related question.
As far as I understand the useFactory in the NgModule section in app.module.ts creates an instance of loggingService. So I am not sure how I would do this without the useFactory part.
Hopefully you can give me some hints in the right direction.
Hi,
Is it possible to have in the modal viewer component present in the npm package, messages saved from previous sessions to the local storage ?
I need that to have multi session logging in the same place over the time.
thanks a lot for your advices and for that wonderful package ! great.
regards,
cesar
Hi,
thanks for the plugin, its working nicely. I was just trying the ajaxAppender and I succeeded sending the log data to my service.
regards
Hello,
Is it possible to make my own appender? Do you have any template for this?
log4javascript provides some infos for custom appenders but i can not figure out how to use it in an ionic project.
I don't get debug messages. Minimum is INFO. Below example will only show warn & info statement. But if I set log level to WARN only warn will be displayed. So info is correctly filtered out
this.logger.setLogLevel(LogLevel.ALL);
this.logger.warn(methodName, 'dummy warn');
this.logger.info(methodName, 'dummy info');
this.logger.debug(methodName, 'dummy debug');
this.logger.trace(methodName, 'dummy trace');
Hi,
when I start my PWA with 'ionic serve' I get the following warning in the browser console:
node_modules\ionic-logging-service\fesm2015\ionic-logging-service.js depends on 'log4javascript'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
I read that you have to import it with a ECMA friendly substitute or just disable the warning for that package. Can you somehow provide an ECMA friendly substitute to your package?
Kind regards
in my app.module.ts I cant import LoggingServiceModule, and when I try to run my app I get the following error:
No provider for LoggingService! ; Zone: ; Task: Promise.then ; Value: Error: No provider for LoggingService!
I'm using the angular 4.4.4, and ionic-logging-service 3.1.0,
Am I missing something?
please let me know how I can resolve this issue.
Thanks
when I try to upgrade my project, that is using ionic-logging-service (think you got most downloads over us), then the ionic-logging-service seems to be incompatible with angular/common 13.
please check this. thank you very much.
Possible this can be updated for Angular 11 support?
Package "ionic-logging-service" has an incompatible peer dependency to "@angular/common" (requires "^9.0.0" (extended), would install "11.2.7").
Thanks again for all your hard work.
Possible you can bump support to angular 12? It works if I npm update --legacy-peer-deps but otherwise throws the following.
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^11.0.0" from [email protected]
npm ERR! node_modules/ionic-logging-service
npm ERR! ionic-logging-service@"^12.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Appreciate all your hard work.
I implemented a simple bug report section and after submission want to clear the logs. How can I do that?
But this method doesn't seem present in your current version. I am using Ionic 5 and Angular 9.
Appreciate all your hard work and time on this.
from #6
from #6:
It would be useful to have a timing feature as followed: Batch log statements until either the batch size is exceeded or a timeout threshold is exceeded. If I use batching right now and the app creates an error it is not sent as the batch threshold is not exceeded yet.
i am confused on how i should access my saved logs on the LocalStorageAppender,
i was expecting to have exported members that would allow me to fetch the logs.
but i can only access getLogMessages stored in memory, while i need to access the logs from local storage.
Thanks,
Would it be possible for you to include a sample Ionic 3 application that uses your logging service and shows how to configure different logging levels for different pages?
I have it partially working, in that I can call logging statements, but I cannot alter the default configuration (so every statement must be WARN or greater to show up).
Will there be an update to support Angular 16? currently we have to install with --legacy-peer-deps
I could try and issue a PR for this if needed.
from #6
Original location/line number from where log is written is lost, is there a way to preserve that?
when we use console.log it will give line number and file name, and when you click on the link it will take you to exact location. But now with this, there is no clue where it came from. we need to search and find
Hello,
thanks for the nice project. We would like to incorporate that into our ionic app. I am just thinking about the reliability of log delivery. If I understand the implementation correctly the logs are appended to AjaxAppender
and are right pushed to the server (after the batch threshold is reached). What happens when the log is created locally but the delivery fails?
Either due to a missing internet connection on the device or due to the server error? Are the logs stored somewhere locally and tried to re-upload them? I have gone through both appenders implementations and don't see such a feature. Is it possible to add that functionality?
This is a crucial requirement for us because we want to use logs to debug the uploading of data from the ionic app to the server so the connection outage can happen during the process.
Hi,
I found a problem in "src/logging.service.ts", lines 78:83, there seems to be a wrong condition.
Also, can you provide an example of setting.json? I tried to change settings to save the log in local storage but without any success.
https://travis-ci.org/Ritzlgrmft/ionic-logging-service/builds/205330556:
$ npm test
> [email protected] test /home/travis/build/Ritzlgrmft/ionic-logging-service
> npm run compile && npm run lint && npm run karma-once
> [email protected] compile /home/travis/build/Ritzlgrmft/ionic-logging-service
> ngc
Error: Error at /home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@types/jasmine/index.d.ts:39:38: A parameter initializer is only allowed in a function or constructor implementation.
Error at /home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@types/jasmine/index.d.ts:39:46: Cannot find name 'keyof'.
Error at /home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@types/jasmine/index.d.ts:39:52: '=' expected.
at check (/home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@angular/tsc-wrapped/src/tsc.js:31:15)
at Tsc.typeCheck (/home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@angular/tsc-wrapped/src/tsc.js:86:9)
at /home/travis/build/Ritzlgrmft/ionic-logging-service/node_modules/@angular/tsc-wrapped/src/main.js:33:23
at process._tickCallback (internal/process/next_tick.js:103:7)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
Compilation failed
The underlying log4javascript.AjaxAppender
which is used by ionic-logging-service.AjaxAppender
, appears to support a second constructor parameter which allows withCredentials
to be set to true. See https://github.com/Ritzlgrmft/log4javascript/blob/master/js/log4javascript_uncompressed.js :1948
However ionic-logging-service.AjaxAppender
does not offer a configuration option to allow this to be set to true.
I could get around this by implementing a new "AuthenticatedAjaxAppender', along the lines you describe in #33 , however it seems like it would be a simple thing to include in the core library.
The use case is that we don't want abuse of an unsecured log endpoint which receives POSTs from an Ionic app, across the public internet.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
Is this an attribute that needs to be added to something like this;
"logging": {
"logLevels": [
{
"loggerName": "root",
"logLevel": "INFO"
}
]
}
Your code example in 'readme.md' does NOT work for me.
Mine has to look this way:
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
AppRoutingModule,
BrowserModule,
IonicModule.forRoot()
],
providers: [
LoggingService,
SplashScreen,
StatusBar,
{
provide: RouteReuseStrategy,
useClass: IonicRouteStrategy
},
{
deps: [LoggingService],
multi: true,
provide: APP_INITIALIZER,
useFactory: configureLogging
}
],
bootstrap: [AppComponent]
})
export class AppModule {}
I only get working code if I do add LoggingService
inside the providers
. I do not believe this is specific to my project.
Hi again, is it possible to release an update to support Angular 17?
If needed I can provide a PR for this, or a supporting PR similar to the Angular 16 upgrade.
Thanks.
In the npm documentation, it is said that the dependencies are the same as in the Ionic Angular v6.1.9.
However, the @ionic/angular package has the "@angular/core: >=12.0.0" mentioned in the peerDependencies.
At the same time, ionic-logging-service has "@angular/core: ^14.0.0".
The teams who use the package, can't upgrade to Angular 15 due to the inconsistencies in the peerDependencies.
Is it not possible to always automatically log the line number or am I missing something?
Is possible to save the logs into a file txt ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.