Skip to content

session_logs

Column NameTypeCommentDefaultNullRemark
idbigint UNSIGNEDPrimary Key IDNOAuto Increment
app_fskeyvarchar(64)Associated Plugin FskeyFresnsNORelated field apps->fskey
Fresns represents the main program logs
typetinyint UNSIGNEDLog Type1NOSee description below
platform_idtinyint UNSIGNEDPlatform IDNOplatforms
versionvarchar(16)Version NumberNOSemantic versioning
app_idchar(8)App IDYESsession_keys->app_id
lang_tagchar(16)Client LanguageYESThe language of the generated log, leave empty if multilingual is not enabled
action_namevarchar(128)Record Target NameNOFunction model name or interface path
For example, model name App\Models\Post
For example, interface path: /api/fresns/v1/account/auth-token
action_descvarchar(128)Record Target ActionYESAction description, custom input content
action_statetinyint UNSIGNEDRecord Action StateNO1. Unknown or in progress / 2. Success / 3. Failure
action_idbigint UNSIGNEDRecord Target IDYESFor example, in case of a publish action, it represents the ID of the posted content
For plugin actions, this ID can be used to query the associated information recorded on the plugin side
account_idbigint UNSIGNEDAccount IDYESRelated field accounts->id
user_idbigint UNSIGNEDUser IDYESRelated field users->id
device_infojsonDevice InformationYES
device_tokenvarchar(128)Device TokenYESFor example, iOS Device Token or Android Device Token
Can be used for push notifications
login_tokenvarchar(64)Login TokenYES
more_infojsonBackup FieldYESFor example, storing operation action snapshots
created_attimestampCreate TimeuseCurrentNOFor example, MySQL defaults to CURRENT_TIMESTAMP
updated_attimestampUpdate TimeYES
deleted_attimestampDelete TimeYES

Log Type

NumberConst NameDescription
1TYPE_UNKNOWNUnknown
2TYPE_PLUGINPlugin
3TYPE_LOGIN_PANELLogin Admin Panel
4TYPE_ACCOUNT_REGISTERAccount - Register
5TYPE_ACCOUNT_LOGINAccount - Login action_id = session_tokens->id
6TYPE_ACCOUNT_UPDATE_DATAAccount - Update Profile
7TYPE_ACCOUNT_UPDATE_PASSWORDAccount - Set or Reset Password
8TYPE_ACCOUNT_DELETEAccount - Delete Account
9TYPE_USER_ADDUser - Create
10TYPE_USER_LOGINUser - Login action_id = session_tokens->id
11TYPE_USER_UPDATE_PROFILEUser - Update Profile
12TYPE_USER_UPDATE_SETTINGUser - Update Setting
13TYPE_USER_UPDATE_PINUser - Set or Reset PIN
14TYPE_USER_DELETEUser - Delete User
15TYPE_WALLET_INCREASEWallet - Transaction Income
16TYPE_WALLET_DECREASEWallet - Transaction Expense
17TYPE_WALLET_UPDATE_PASSWORDWallet - Set or Reset Password
18TYPE_POST_CREATE_DRAFTPost - Create Draft
19TYPE_POST_REVIEWPost - Submit for Review
20TYPE_POST_PUBLISHPost - Publish
21TYPE_POST_DELETEPost - Delete
22TYPE_POST_LOG_DELETEPost Log - Delete
23TYPE_COMMENT_CREATE_DRAFTComment - Create Draft
24TYPE_COMMENT_REVIEWComment - Submit for Review
25TYPE_COMMENT_PUBLISHComment - Publish
26TYPE_COMMENT_DELETEComment - Delete
27TYPE_COMMENT_LOG_DELETEComment Log-Delete
28TYPE_MARK_LIKEAction Like
29TYPE_MARK_DISLIKEAction Dislike
30TYPE_MARK_FOLLOWAction Follow
31TYPE_MARK_BLOCKAction Block
32TYPE_UPLOAD_FILEUpload File
33TYPE_CONVERSATION_MESSAGEConversation Message

Device Information JSON

networkIpv4 and networkIpv6 are required to fill in at least one, or both can be filled in. The rest can be left blank.

json
{
    "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
    "type": "Desktop", // Desktop, Mobile, Tablet, Bot
    "platformName": "Mac 10.15.7",
    "platformFamily": "Mac",
    "platformVersion": "10.15.7",
    "browserName": "Chrome 126",
    "browserFamily": "Chrome",
    "browserVersion": "126",
    "browserEngine": "Blink",
    "deviceFamily": "Apple",
    "deviceModel": "Mac",
    "deviceMac": "2c:89:dc:71:b6:12",
    "appImei": null,
    "appAndroidId": null,
    "appOaid": null,
    "appIdfa": null,
    "simImsi": null,
    "networkType": "wifi",
    "networkIpv4": "137.132.250.10",
    "networkIpv6": null,
    "networkPort": "8080",
    "networkTimezone": "Asia/Singapore",
    "networkOffset": 28800,
    "networkIsp": "National University of Singapore",
    "networkOrg": "National University of Singapore",
    "networkAs": "AS7472 NUS Information Technology",
    "networkAsName": "NUS-AS-AP",
    "networkReverse": null,
    "networkMobile": false,
    "networkProxy": false,
    "networkHosting": false,
    "mapId": 2, // Dictionary data: Map service provider number
    "latitude": 1.29758,
    "longitude": 103.773,
    "continent": "Asia",
    "continentCode": "AS",
    "country": "Singapore",
    "countryCode": "SG",
    "region": "Central Singapore",
    "regionCode": "01",
    "city": "Singapore",
    "cityCode": "SG",
    "district": "Queenstown",
    "address": null,
    "zip": "119259"
}

Released under the Apache-2.0 License