3

I have developed an Azure Function and I run it locally with with "mvn azure-functions:run" command. How do I change the console log level? It appears to be INFO, and prints something like this:

[3/10/18 9:26:38 PM] Generating 1 job function(s)
[3/10/18 9:26:38 PM] Starting Host (HostId=pollux-1571256755, Version=2.0.11587.0, ProcessId=18280, Debug=False, ConsecutiveErrors=0, StartupCount=2, FunctionsExtensionVersion=)
[3/10/18 9:26:38 PM] Found the following functions:
[3/10/18 9:26:38 PM] Host.Functions.post
[3/10/18 9:26:38 PM]
[3/10/18 9:26:38 PM] Job host started
info: Worker.Java.aa343152-8252-4f5b-88bf-664d1f8e0c3e[0]
      Listening for transport dt_socket at address: 5005
info: Worker.Java.aa343152-8252-4f5b-88bf-664d1f8e0c3e[0]
      Microsoft Azure Functions Java Runtime [build 1.0.0-beta-3]
info: Worker.Java.aa343152-8252-4f5b-88bf-664d1f8e0c3e[0]
      [INFO] {MessageHandler.handle}: Message generated by "StartStream.Builder"
info: Worker.Java.aa343152-8252-4f5b-88bf-664d1f8e0c3e[0]
      Worker initialized
info: Worker.Java.aa343152-8252-4f5b-88bf-664d1f8e0c3e[0]
      "post" loaded (ID: 7e6b5aa1-d8d9-496b-ba34-ba12d562e8af, Reflection:   "C:\git\codestrong-a2\jscraper-azure-poster\target\azure-functions\jscraper-azure-poster-20180310145647740\jscraper-azure-poster-0.0.1-SNAPSHOT.jar"::"biz.codestrong.azure.AzureQueuePoster.post")

But I need it to be DEBUG or lower. In my function code, I have a line like this:

context.getLogger().log(Level.FINE, "Created queue client " + queueClient);

This line never prints as it is.

Jerry Liu
  • 17,282
  • 4
  • 40
  • 61
anton1980
  • 979
  • 3
  • 10
  • 20
  • Possible duplicate of [Why are the Level.FINE logging messages not showing?](https://stackoverflow.com/questions/6315699/why-are-the-level-fine-logging-messages-not-showing) – Jerry Liu Jun 15 '18 at 08:58

1 Answers1

-1

I don't know the actual answer, but here are 2 ideas:

  1. Create a src/main/resources/application.properties with this content:
logging.level.com.azure.cosmos=DEBUG
  1. IN your host.json, put this:
"tracing":
{
  "consoleLevel": "verbose"
}

Neither one of those worked for me, but I think I am on the right track.

I use Lombok for logging config, and you should too.

djangofan
  • 28,471
  • 61
  • 196
  • 289