Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug No Logs

Discussion in 'Cloud Code' started by Iamoptimistic, Apr 4, 2024.

  1. Iamoptimistic

    Iamoptimistic

    Joined:
    Jan 7, 2020
    Posts:
    5
    Hi everyone,

    It seems the Unity Cloud has problems with fetching logs. I'm not sure if it specific to me, but I can only find sporadic log entries. The only return value when calling from the API is:

    {'offset': 0, 'limit': 100, 'results': [{'timestamp': '2024-04-04T11:12:11.23Z', 'severityText': 'INFO', 'severityNumber': 9, 'body': 'GetInviteLink: xxx', 'resourceAttributes': {'service.name': 'cloud-code', 'telemetry.sdk.language': 'dotnet'}, 'logAttributes': {'code.function': 'MoveNext', 'code.namespace': 'xxx', 'faas.name': 'GetInviteLink', 'log.record.uid': 'a406aa58-2217-40eb-b633-362dec339d3e', 'unity.environmentId': 'yyy', 'unity.projectId': 'yyy', 'unity.userId': 'yyy'}}]}

    However, there should have been many more logs.
    This is the same in the dashboard.

    I know that cloud functions are executing, but logs do not appear. Is this a problem with the logger setup? I use the logger interface passed to my module instance.

    (I had a similar problem where recent logs where only shown when setting the range to the past 7 days.)

    Best
    (Sorry for the bold font, the wysiwyg forum editor displayed as white text to me)
     
  2. KaloyanMarshalov

    KaloyanMarshalov

    Unity Technologies

    Joined:
    Mar 11, 2021
    Posts:
    2
    Hey @Iamoptimistic

    We haven't experienced any recent outages with the logging system so this might be a bug indeed. Can I ask you for a few things to help us debug:
    • Can you provide a snippet of your code where you initialize the logger in the constructor and also how you're using it in the method itself. There might be an edge case in usage that we've missed. Can you also provide the version of
      Microsoft.Extensions.Logging
      that you're using?
    • Can you post the API request that you're making? Any format suits or if you're using the dashboard, a screenshot of the query console would be perfect.
    • Make sure that the logs lines in your code are before any code paths that might throw exceptions and your code is executing successfully. Unfortunately, we don't provide out of the box logs for a lot of things in Cloud Code like unhandled exceptions or timeouts, but it is something we're looking to provide in the future.
    Hopefully that should be enough for me to go by but if not we can continue to dive deeper.