FaceTec Server Request Logging
FaceTec Server supports Request Logging to the file system, as well as several common storage services.
Overview
For auditing and diagnostic purposes, FaceTec recommends saving all API Requests that are sent to your team's FaceTec Server. However, API Requests can contain some large data objects, such as 3D FaceMaps, Session Request Blobs, and Images. Instead of your team's database, it is generally recommended that your team save these API Requests to a file system or storage service.
By default, FaceTec Server is able to log API Requests to the file system, AWS S3, and Google Cloud Storage. Other storage services can also be supported by implementing the FaceTecRequestLogging Class.
Please Note: FaceTec's API Requests contain large data objects and storing these will have a storage and cost impact. Your team should configure a data retention policy that aligns with your team's own business requirements.
Enable Request Logging
In your team FaceTec Server's config.yaml file, Request Logging can be enabled by setting enableRequestLogging to true in the requestLogging section. The file system or storage service that your team uses for logging can be specified with requestLoggingMode. The example below shows how to enable Request Logging for a machine's file system.
requestLogging:
# Option to enable request logging.
enableRequestLogging: true
# Currently only "file_system_logging", "aws_s3_logging", "google_cloud_storage_bucket_logging" are supported.
requestLoggingMode: file_system_loggingFile System Request Logging
File System Request Logging is the simplest option for storing your team's logs. This will store logs in the facetec-request-logs folder on your machine.
Please Note: If your team is running your FaceTec Server in a Docker Container, then these logs will be ephemeral and will not be saved on your Host Machine unless a persistent directory is mounted in your team's Docker Compose File.
Below is an example of how to update docker-compose.yml so that facetec-request-logs is mounted to a persistent host directory:
volumes:
- ./facetec-request-logs:/home/FaceTec_Server/deploy/facetec-request-logsBelow is an example of a file_system_logging configuration:
file_system_logging:
# The frequency in minutes that FaceTec Server save current log files.
logFileSaveFrequencyInMinutes: 5AWS S3 Bucket Logging
This mode will upload log files to a configured Amazon S3 bucket, then delete the old log from the machine.
To configure your S3 bucket, your team will need to verify that its Server and Bucket have the correct permissions. Afterwards, your team will need to configure region and bucketName in the aws_s3_logging section of your FaceTec Server Webservice's config.yaml file.
# REQUIRED if requestLogging is enabled and using 'aws_s3_logging' mode.
# AWS S3 Request Logging.
# Enabling this feature will store all requests into the configured S3 Bucket.
aws_s3_logging:
# The region the S3 bucket is in.
region: us-west-2
# bucket name to store logs to.
bucketName: facetec-request-logging
# The frequency in minutes that FaceTec Server will upload logs to S3.
logFileSaveFrequencyInMinutes: 5For information on configuring data retention, please see AWS's Guide for Managing the Storage Lifecycle.
Google Cloud Storage Bucket Logging
This mode will upload log files to a configured Google Cloud Storage Bucket, then delete the old log from the machine.
To configure your Google Cloud Storage Bucket, your team will need to verify that its Server and Bucket have the correct permissions. Afterwards, your team will need to configure projectId and bucketName in the google_cloud_storage_bucket_logging section of your FaceTec Server Webservice's config.yaml file.
# REQUIRED if requestLogging is enabled and using 'google_cloud_storage_bucket_logging' mode.
# Google Cloud Storage Bucket Request Logging.
# Enabling this feature will store all requests into the configured Google Cloud Storage Bucket.
google_cloud_storage_bucket_logging:
# The projectId that the bucket is in.
projectId: "GoogleCloudStorageProjectId"
# bucket name to store logs to.
bucketName: "facetec-request-logging"
# The frequency in minutes that FaceTec Server will upload logs to GCS.
logFileSaveFrequencyInMinutes: 5For information on configuring data retention, please see GCS's Guide for Managing Data Retention.