Is it possible to log MySQL variable changes?
You can log changes that are made on-the-fly using the audit plugin.  You can get that from here https://www.percona.com/doc/percona-server/LATEST/management/audit_log_plugin.html - variable changes are logged as SET commands.

The max_allowed_packet variable is set on both the client and the server - so in the [client] section and the [mysqld] section of the ini files (my.cnf for linux or my.ini for windows). 

The variable may also be getting set in your application API, so you would need to check and change that too. 

Finally there is an observation in the book High Performance MySQL that max_allowed_packet also controls the maximum size of a user-defined variable. These can be truncated or set to NULL if that max value is exceeded.