Skip to main content

Intercept and modify data with hook

Comments

2 comments

  • kdub
    I guess I answered my own question. I followed the guide Tutorial - Create a Standardized Hook - Developer Documentation - cPanel Documentation to write a hook as a perl module to test. Turns out you can easily modify the existing key values or add values for unset keys that are supported by the cpanel script. # $data is a referenced hash so accessing them is fairly straight forward # for example the key 'domain' inside the nested hash 'args' inside $data $data->{'args'}->{'domain'} = 'domain.tld';
    Do scripts provide the same capabilities or is it only modules? For some reason what's not working is the alternate_logfile so I can output logs to a file other than the default error_log. The below code should work but info is still logged only to error_log. The file exists. I don't understand. my $logger = Cpanel::Logger->new( { 'alternate_logfile' => '/usr/local/cpanel/logs/myhook_log' } );
    0
  • cPanelMichael
    Hello @kdub, Our Integration Developers should be able to better answer your question about this topic. Can you send this question via email to integration@cpanel.net and let us know the outcome once you receive an answer? Thank you.
    0

Please sign in to leave a comment.