Hi @ZZ Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
I am not sure if the first option of sending logs from mylib.mytest to appear in the logs of function A is possible.
For setting log level at the function, in addition to adding the above mentioned statements, you can adjust the same by modifying the log level in host.json
file. Please find more details in the documentation Control volume and verbosity of logs Here is a sample setting
{
"version": "2.0",
"logging": {
"logLevel": {
"default": "Information", // catch all default, with modifications below for individual categories.
"Function": "Warning", // Warning level from all Functions (except the ones configured below).
"Host.Aggregator": "Trace", // Log all traces in the 'customMetrics' table of (and shown on Metrics/Alerts blade in AI) - use either this or Host.Results
"Host.Results": "Error", // Error and Critical requests are only logged in the 'requests' table of the AI (and shown on Monitor Functions blade in Functions App) - use either this or Host.Aggregator
"Function.Function1": "Information", //Information level logs from Function 1, logged in 'traces', 'dependencies' and 'customMetrics' tables of AI
"Function.Function2.User": "Information" //user code logs from Function2, logged in 'traces' table of AI
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"maxTelemetryItemsPerSecond": 1,
"excludedTypes": "Exception"
}
}
}
}
Hope this helps! Please let us know if you have additional questions or need further assistance.