I am logging Filemaker changes using MBS plug-in. As I must log all type of actions, I must log CWP changes too.
So I am looking for suggestions. Please let me know, How can I log, CWP (PHP) changes?
Thank you for you suggestion.
Is there any plugin to record the logs like MBS plugin( we are using this for Filemaker logs).?
Well, it depends on how you're logging, but you can run a script via CWP with a few lines of code:
https://fmhelp.filemaker.com/docs/16/en/fms16_cwp_guide.pdf (page 75)
Like so in PHP
$newPerformScript = $fm->newPerformScriptCommand('Your Script Name', 'LayoutUsed', 'Parameters'); $result = $newPerformScript->execute();
$newPerformScript = $fm->newPerformScriptCommand('Your Script Name', 'LayoutUsed', 'Parameters');
$result = $newPerformScript->execute();
assuming you've already created an $fm object representing your filemaker connection (assuming you already have that in place if you're using CWP).
'Parameters' can be substituted with a $parameters variable of something that you want to pass to that script to run.
On the filemaker side, that script would just be something simple like:
Set Variable [ $p ; get(scriptparameter) ]# Perform some kind of log action saving the data from $p
Set Variable [ $p ; get(scriptparameter) ]
# Perform some kind of log action saving the data from $p
So yeah, should be pretty simple to run a "logger" script using CWP to record any actions you want to log.
Did you try MBS plugin with CWP?
I know our plugin can be used with CWP, but not sure whether FMS triggers the plugin when a record changes.
I never use a plugin for logging. Simple enough to do in FileMaker without it so I've never had a need.
You could write a small (FREE) micro-service that would write (append) to a text (or any format file you dream up that you "serialize") and just have lots of INSERT FROM URL statements in FMP.
That implementation is a far cry from a real logging solution freely available in modern programming languages (such as log4j), but you could at least implement "basic" logging statements.
Using MBS' text functions would be another way to do it.
ditto! it's CWP with a full set of PHP functions to do as you need without anything else.
Just for notes, I have found in the past that directly using the new record routine via PHP has less overhead than calling a script, I haven't tested this overhead with newer versions of FileMaker Server but I assume since running a script makes a user session that it would still be the same. So if your logging is going to occur frequently then perhaps make a routine you can call that will directly add a record to a table rather than using the perform script method.
This might be of interest to you:
NightWing Enterprises - UltraLog v2.x Audit Logging System for FileMaker
Yah, I had tried MBS plug-in(Client version) with CWP (PHP).
Currently, I created a script in Filemaker added as script trigger to fire it when record is created, modified through CWP.
But It did not work. Please Let me know how it works, If it supports the CWP.
You marked this thread as "correct".
Are you able to log as needed now?
If not, PHP should let you write to text files, right?
If not, from PHP, you can call a micro-service that can do whatever you want/need.
That was my mistake.
No.I am not able to log yet.
Actually I know less PHP. Thank you for your suggestion. I will look into that.
Retrieving data ...