GithubHelp home page GithubHelp logo

ritzlgrmft / ionic-logging-service Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 17.0 6.77 MB

This service encapsulates log4javascript's functionalities for apps built with Ionic framework.

JavaScript 1.71% TypeScript 90.59% CSS 0.05% HTML 5.82% SCSS 1.82%

ionic-logging-service's People

Contributors

dependabot[bot] avatar ritzlgrmft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ionic-logging-service's Issues

The automated release is failing 🚨

🚨 The automated release from the 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.


Missing 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 πŸ“¦πŸš€

Calling configureLogging in app.module.ts

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.

Configure ajax extender

Hi,

thanks for the plugin, its working nicely. I was just trying the ajaxAppender and I succeeded sending the log data to my service.

  • Is there a way to enable/disable the ajaxAppender in code, as I want to enable this feature only when the users checks a checkmark
  • Can i add a special information to each log statement (sent via ajaxAppender) so that I can identify the device? If multiple apps run at the same time I do not know which log statements go together
  • 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 threashold is not exceeded yet.

regards

Custom Appender

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.

minimum log level INFO

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');

Import ECMA substitute

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

I have a problem running this logger for ionic 3 /angular4

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

upgrade to Angular 13

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.

Angular 11 Support

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.

Bump Angular 12 support

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.

How to: unable to read logs saved on local browser storage.

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,

Sample Ionic 3 project?

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).

Angular 16 support

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.

Original location/line number from where log is written is lost,

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

What happens when app is offline?

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.

localStorageAppender problem

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.

Travis CI build fails

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

Config option to allow AjaxAppender withCredentials=true

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.

The automated release is failing 🚨

🚨 The automated release from the 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.


Invalid npm token.

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 πŸ“¦πŸš€

erroneous code example in readme.md

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.

Angular 17 support

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.

Include @angular/core: >=12.0.0 in the peerDependencies (Angular 15 support)

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".

Why this is important?

The teams who use the package, can't upgrade to Angular 15 due to the inconsistencies in the peerDependencies.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.