ErrorLog
--------

Queries error log.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Plugin](component_Plugin.md) | [12.3](newinversion123.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "ErrorLog" ) ### Parameters

none

### Result

Returns JSON or error.

### Description

Queries error log.  
Error log gets activated with [ClearErrors](ClearErrors.md), which also clears all entries.  
Please call [ClearErrors](ClearErrors.md) function on beginning of a script and then on the end of the script, use [HadErrors](HadErrors.md) function to check if there was a problem. Use this function to query JSON with error details.   
  
Querying the error log using ErrorLog function turns it off until the next call to [ClearErrors](ClearErrors.md) function. You can add own entries with [AddToErrorLog](AddToErrorLog.md) function.  
  
Errors are tracked per thread, so on a server each PSoS session has its own error log. And it includes errors from subscripts.  
  
Our error log is in addition to [trace](component_Trace.md) functions and [Plugin.SetErrorScriptTrigger](PluginSetErrorScriptTrigger.md) function.  
### Examples

Try the error log:

 # test Errors in file Kontakte   
  
\# start error logging   
Set Variable \[ $r ; Value: MBS ("ClearErrors") \]   
\#   
\# cause some errors   
Set Variable \[ $r ; Value: MBS ("test"; 1; "Hello") \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.Print](DynaPDFPrint.md)"; 1; "Hello") \]   
\#   
\# now query error log   
Set Variable \[ $r ; Value: MBS ("ErrorLog") \]   
Show Custom Dialog \[ "Error Log" ; $r \]  
<small>  
Example result:   
\[ { "function" : "test" , "result" : "\[MBS\] Unknown function: test" , "parameter" : \["test" , 1 , "Hello" \], "fileName" : "Kontakte" , "scriptName" : "test Errors" , "currentTimeStamp" : "23.06.2022 09:28:34" }, { "function" : "DynaPDF.Print" , "result" : "\[MBS\] DynaPDF.Print is only supported for Windows. Please use PDFKit.Print on Mac." , "parameter" : \[ "DynaPDF.Print" , 1 , "Hello" \], "fileName" : "Kontakte" , "scriptName" : "test Errors" , "currentTimeStamp" : "23.06.2022 09:28:34" } \] </small>### See also

- [AddToErrorLog](AddToErrorLog.md)
- [ClearErrors](ClearErrors.md)
- [DynaPDF.Print](DynaPDFPrint.md)
- [HadErrors](HadErrors.md)
- [PDFKit.Print](PDFKitPrint.md)
- [Plugin.SetErrorScriptTrigger](PluginSetErrorScriptTrigger.md)

### Release notes

- **Version 12.3**
    - Added [ErrorLog](https://www.mbsplugins.eu/ErrorLog.shtml) function to query JSON of errors from function calls in [MBS FileMaker Plugin](https://www.monkeybreadsoftware.com/filemaker/) since last call to [ClearErrors](https://www.mbsplugins.eu/ClearErrors.shtml) function.

### Blog Entries

- [MBS @ FMTraining.TV - The FileMaker MonkeyBread Plug-in Q&amp;A](https://www.mbsplugins.de/archive/2024-07-03/MBS_@_FMTrainingTV_-_The_FileM/monkeybreadsoftware_blog_filemaker)
- [MBS @ FMTraining.TV - Error Capturing with the MBS Plugin - FileMaker MBS Q&amp;A](https://www.mbsplugins.de/archive/2024-03-21/MBS_@_FMTrainingTV_-_Error_Cap/monkeybreadsoftware_blog_filemaker)
- [Control printing in FileMaker with MBS Plugin on Windows](https://www.mbsplugins.de/archive/2023-06-12/Control_printing_in_FileMaker_/monkeybreadsoftware_blog_filemaker)
- [FileMaker and MongoDB](https://www.mbsplugins.de/archive/2023-03-20/FileMaker_and_MongoDB/monkeybreadsoftware_blog_filemaker)
- [Top 10 from the MBS Plugin in 2022](https://www.mbsplugins.de/archive/2022-12-29/Top_10_from_the_MBS_Plugin_in_/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 12.4 for Claris FileMaker](https://www.mbsplugins.de/archive/2022-09-06/MBS_Plugin_124_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.3](https://www.mbsplugins.de/archive/2022-07-19/MBS_FileMaker_Plugin_123/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 12.3 for Claris FileMaker](https://www.mbsplugins.de/archive/2022-07-12/MBS_Plugin_123_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [New error log functions for FileMaker](https://www.mbsplugins.de/archive/2022-06-23/New_error_log_functions_for_Fi/monkeybreadsoftware_blog_filemaker)
- [Looping over records in FileMaker with error checking](https://www.mbsplugins.de/archive/2020-03-22/Looping_over_records_in_FileMa/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 23th June 2022 , last changed 14th March 2024

  
[EnvironmentVariables.Value](EnvironmentVariablesValue.md) - [EventMonitor.Clear](EventMonitorClear.md)

[HTML Version](ErrorLog.shtml)