Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Logging logLevels #163

Open
antempus opened this issue Feb 18, 2020 · 2 comments
Open

Question: Logging logLevels #163

antempus opened this issue Feb 18, 2020 · 2 comments
Labels
Enhancement New feature or request P2 Priority 2 item

Comments

@antempus
Copy link

antempus commented Feb 18, 2020

With the logging property for host.json we've have the 6 levels as defined here and they are all working as expected, but the function runtime outputs a large amount of information about when a function is Executed/Executing. I couldn't find solid documentation when it comes to turning off the runtime Executed/Executing messages without also disabling my own log messages at the Information level as defined.

Given the following example it would be helpful to know if there is an option for more granular control:

loggging.logLevel.default = Information

Executed 'Functions.SomeFunction' (Succeeded, Id=SomeId)
Did some work in SomeFunction
Executing 'Functions.SomeFunction' (Reason='', Id=SomeId)

What I would expect is that Executed/Executing logs would be running at the Trace/Debug level rather than the Information level, but when setting the log level higher than Information to something like Warning is predictably suppressing my own log messages resulting in the following:

logging.logLevel.default = Warning

Are there ways of configuring the host.logging property to restrict the logging of the Executed/Executing information or do I just need to break the Log Level definitions and make my messages all 1 level higher? I'd prefer not to do the latter as that could cause some problems capturing invalid warnings and being altered to false positives.

@ghost ghost added the Needs: Triage 🔍 label Feb 18, 2020
@anthonychu
Copy link
Member

I think the best we can do right now is to specify the log levels in host.json like this answer.

{
  "version": "2.0",
  "logging": {
    "logLevel": {
      "Function.MyFunctionName1.User": "Information",
      "Function.MyFunctionName2.User": "Information",
      "Function": "Error"
    }
  }
}

Unfortunately, the way the log categories are set currently, I think we need to specify a rule for every function. @brettsam is there a better way to do this or are there any improvements planned in this area?

@antempus
Copy link
Author

Makes sense. I was hoping it was more granular as our largest function app has ~12 functions in it, but this is definitely doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request P2 Priority 2 item
Projects
None yet
Development

No branches or pull requests

3 participants