Inserting logs for File Uploaded through AS2 on JSCAPE Server
To get the logs inserted into the log database you need to create a single trigger in JSCAPE with multiple trigger actions defined in a certain order. To create a trigger:
-
Open JSCAPE MFT Server web interface.
-
Create a Trigger with "File Upload" selected as the Event Type.

-
Click Next and configure the Trigger Condition.
-
Click Next to define the Trigger Action.
-
First, add the trigger action "Rename File" to append the time stamp to the incoming file.
For adding the time-stamp to the incoming file use the following values for the Rename File trigger action parameters:
File: %LocalPath%
DestinationFile: %LocalDir%/%Month%%DayOfMonth%%Year%%Hour%%Minute%%Second%-%Millisecond%%Name%
-
After that add "SQL Query" trigger action in the same trigger.

Jdbc url: Provide the jdbc URL of the Adeptia log database.
Username: Username of the Adeptia log database.
Password: Password for the Adeptia log database.Use the following QUERY in the SQL Query trigger action:
INSERT INTO AU_AS2LOG(AU_FILE_SIZE, AU_CLIENT_HOST, AU_CLIENT_PORT, AU_DOMAIN_NAME, AU_LOCAL_DIR, AU_FILE_NAME,AU_SESSION_ID, AU_STATUS, AU_ORIGINAL_MESSAGEID, AU_TYPE, AU_FILE_MODIFIED_NAME,
AU_AS2_FROM,AU_AS2_TO,AU_TIMESTAMP) VALUES('%Bytes%', '%ClientIP%', '%ClientPort%','%DomainName%', '%LocalDir%', '%Name%', '%Sessionid%', '%Success%', '%AS2.MessageId%',
'INBOUND', '%Month%%DayOfMonth%%Year%%Hour%%Minute%%Second%%Millisecond%%Name%', '%AS2.Sender%',
'%AS2.Recipient%', unix_timestamp('%Year%%Month%-%DayOfMonth% %Hour%:%Minute%:%Second%')*1000+%Millisecond%)This SQL query action will log the information of the incoming file to the log database of Adeptia.
-
Click OK.
