You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-java.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ with the corresponding `function.json`:
88
88
89
89
Azure Functions supports the use of third-party libraries. By default, all dependencies specified in your project `pom.xml` file will be automatically bundled during the `mvn package` goal. For libraries not specified as dependencies in the `pom.xml` file, place them in a `lib` directory in the function's root directory. Dependencies placed in the `lib` directory will be added to the system class loader at runtime.
90
90
91
-
## Data Types
91
+
## Data type support
92
92
93
93
You can use any data types in Java for the input and output data, including native types; customized Java types and specialized Azure types defined in `azure-functions-java-library` package. The Azure Functions runtime attempts convert the input received into the type requested by your code.
94
94
@@ -238,7 +238,7 @@ public class MyClass {
238
238
239
239
Interact with Azure Functions execution environment via the `ExecutionContext` object defined in the `azure-functions-java-library` package. Use the `ExecutionContext` object to use invocation information and functions runtime information in your code.
240
240
241
-
### Logging
241
+
### Custom logging
242
242
243
243
Access to the Functions runtime logger is available through the `ExecutionContext` object. This logger is tied to the Azure monitor and allows you to flag warnings and errors encountered during function execution.
244
244
@@ -259,6 +259,29 @@ public class Function {
259
259
}
260
260
```
261
261
262
+
## View logs and trace
263
+
264
+
You can use the Azure CLI to stream Java standard out and error logging as well as other application logging. First, Configure your Function application to write application logging using the Azure CLI:
265
+
266
+
```azurecli-interactive
267
+
az webapp log config --name functionname --resource-group myResourceGroup --application-logging true
268
+
```
269
+
270
+
To stream logging output for your Function app using the Azure CLI, open a new command prompt, Bash, or Terminal session and enter the following command:
271
+
272
+
```azurecli-interactive
273
+
az webapp log tail --name webappname --resource-group myResourceGroup
274
+
```
275
+
The [az webapp log tail](/cli/azure/webapp/log) command has options to filter output using the `--provider` option.
276
+
277
+
To download the log files as a single ZIP file using the Azure CLI, open a new command prompt, Bash, or Terminal session and enter the following command:
278
+
279
+
```azurecli-interactive
280
+
az webapp log download --resource-group resourcegroupname --name functionappname
281
+
```
282
+
283
+
You must have enabled file system logging in the Azure Portal or Azure CLI before running this command.
284
+
262
285
## Environment variables
263
286
264
287
Keep secret information such as keys or tokens out of your source code for security reasons. Use keys and tokens in your function code by reading them from environment variables.
0 commit comments