newrelic / newrelic-flutter-agent

New Relic agent SDK for Flutter hybrid mobile apps
Apache License 2.0
6 stars 12 forks source link

unable to send logs using the NewRelic Mobile SDK. #78

Closed hohoins closed 1 month ago

hohoins commented 6 months ago

I am unable to send logs using the NewRelic Mobile SDK. Does NewRelic Mobile SDK support sending custom text message logs? I couldn't find the log transfer API in the sdk. I wonder how I can transmit log messages.

exaple log log_example

ndesai-newrelic commented 6 months ago

@hohoins Are you currently utilizing our Logs API for transmitting logs? Please note that our existing Logs API supports TLS 1.2. We're excited to announce plans to incorporate logs functionality for mobile in the next quarter. As developments unfold and this feature becomes available, we will provide updates here.

hohoins commented 6 months ago

@hohoins Are you currently utilizing our Logs API for transmitting logs? Please note that our existing Logs API supports TLS 1.2. We're excited to announce plans to incorporate logs functionality for mobile in the next quarter. As developments unfold and this feature becomes available, we will provide updates here.

Thank you very much for your reply. 👍👍👍👍👍

What I understand is below:

Then, we will wait for the log message sending function to be added in the next quarter. thank you 🙇🙇🙇

ndesai-newrelic commented 6 months ago

@hohoins we are automatically collected print statement as custom event ,you can do query using this *SELECT FROM Mobile Dart Console Events SINCE 30 MINUTES AGO**

hohoins commented 6 months ago

@hohoins we are automatically collected print statement as custom event ,you can do query using this *SELECT FROM Mobile Dart Console Events SINCE 30 MINUTES AGO**

Does this mean that logs are automatically collected when using 'NewrelicMobile.instance.recordCustomEvent()'? After this, I can check using the query 'SELECT * FROM Mobile Dart Console Events SINCE 30 MINUTES AGO'. I couldn't check the log using recordCustomEvent().

I was able to check the log when I directly called 'https://log-api.newrelic.com/log/v1.'

"plans to incorporate logs functionality for mobile in the next quarter." I look forward to the rapid integration of the LOG API into the newRelic mobile sdk.

thank you

ndesai-newrelic commented 5 months ago

yes, if you are using print statement anywhere in the flutter, we will automatically collected those statement as logs.

ndesai-newrelic commented 1 month ago

@hohoins We're excited to announce the release of mobile logs for our Flutter agent. You can now enable this feature in your application settings page on the New Relic platform. This new capability allows you to capture and analyze logs directly from your Flutter mobile applications, providing deeper insights into your app's behavior. To enable mobile logs:

  1. Log into your New Relic account
  2. Navigate to your application settings page for mobile apps
  3. Look for the mobile logs option
  4. Enable the feature

If you have any questions about this new feature or need assistance enabling it, please don't hesitate to reach out to our support team. We're here to help you make the most of this powerful new tool.

hohoins commented 1 month ago

@hohoins We're excited to announce the release of mobile logs for our Flutter agent. You can now enable this feature in your application settings page on the New Relic platform. This new capability allows you to capture and analyze logs directly from your Flutter mobile applications, providing deeper insights into your app's behavior. To enable mobile logs:

  1. Log into your New Relic account
  2. Navigate to your application settings page for mobile apps
  3. Look for the mobile logs option
  4. Enable the feature

If you have any questions about this new feature or need assistance enabling it, please don't hesitate to reach out to our support team. We're here to help you make the most of this powerful new tool.

I'll check it out. Thank you. 👍👍👍👍👍👍👍👍👍

hohoins commented 1 month ago

@ndesai-newrelic
Thank you very much. 👍👍👍👍👍

I am trying to apply the API transmission function to the product. flutter package newrelic_mobile: 1.1.1 I checked the log function. The result is that the log is recorded normally.

If the log cannot be sent due to network blocking, etc., it is temporarily stored and then transmitted to the server, right? I asked a question for confirmation.

The result I checked is that when the device's newtwork is turned off, if the log API is called, it is stored as permanent data and the log is transmitted when the network is turned on again.

ndesai-newrelic commented 1 month ago

@hohoins it will record the log even if application does not have network.

agilst commented 1 week ago

@ndesai-newrelic Logs are not recorded on NewRelic using newrelic_mobile: ^1.1.3 and tested using iPhone Simulator

Screenshot 2024-09-26 at 11 45 34

Here is my NewRelic init:

  Config config = Config(accessToken: appToken);

  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    FlutterError.onError = NewrelicMobile.onError;
    await NewrelicMobile.instance.startAgent(config);
    runApp(const MyApp());
  }, (Object error, StackTrace stackTrace) {
    NewrelicMobile.instance.recordError(error, stackTrace);
  });

and here is I used for logging: NewrelicMobile.instance.logInfo('Navigate to: $_currentIndex'); I noticed that .logInfo using print() statement so I assumed it will be recorded to NewRelic. Is there anything I missed?

hohoins commented 1 week ago

@ndesai-newrelic Logs are not recorded on NewRelic using newrelic_mobile: ^1.1.3 and tested using iPhone Simulator

Screenshot 2024-09-26 at 11 45 34 Here is my NewRelic init:

  Config config = Config(accessToken: appToken);

  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    FlutterError.onError = NewrelicMobile.onError;
    await NewrelicMobile.instance.startAgent(config);
    runApp(const MyApp());
  }, (Object error, StackTrace stackTrace) {
    NewrelicMobile.instance.recordError(error, stackTrace);
  });

and here is I used for logging: NewrelicMobile.instance.logInfo('Navigate to: $_currentIndex'); I noticed that .logInfo using print() statement so I assumed it will be recorded to NewRelic. Is there anything I missed?

Have you enabled the logging feature for the entity? Application> Mobile Logs> switch on

스크린샷 2024-09-26 오후 2 26 38
agilst commented 1 week ago

OK my bad it's not enabled on my Settings. I assumed my issue is resolved. thanks for your support!

Screenshot 2024-09-26 at 12 46 15