<p>I have a wrote an ansible based kubernetes operator and I am trying to figure out a way to reduce the log generated by the operator deployment pod by reducing the log verbosity level.</p>
<blockquote>
<p>kubectl logs netqedge-7f8885fb85-5jk9c</p>
</blockquote>
<p>netqedge is the ansible based operator</p>
<p>Operator Logs</p>
<pre><code>{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0016239,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/version&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0037427,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/version/openshift&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0057838,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0111895,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/api/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.014386,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/apiregistration.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0161085,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/apps/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0179722,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/authentication.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0196064,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/authorization.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.021108,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/autoscaling/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0225985,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/batch/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0239842,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/networking.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0253205,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/rbac.authorization.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.026974,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/storage.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0284228,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/admissionregistration.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0300376,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/apiextensions.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0317163,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/scheduling.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0351508,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/coordination.k8s.io/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0369577,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.038904,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator.netqapp/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0419142,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator.netqcentral/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0439467,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator.netqclustermanager/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.046197,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator.netqedge/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0479949,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/com.cumulus.netq.operator.netqkafka/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0496933,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/crd.projectcalico.org/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}
{&quot;level&quot;:&quot;info&quot;,&quot;ts&quot;:1620286574.0518043,&quot;logger&quot;:&quot;proxy&quot;,&quot;msg&quot;:&quot;Skipping cache lookup&quot;,&quot;resource&quot;:{&quot;IsResourceRequest&quot;:false,&quot;Path&quot;:&quot;/apis/monitoring.coreos.com/v1&quot;,&quot;Verb&quot;:&quot;get&quot;,&quot;APIPrefix&quot;:&quot;apis&quot;,&quot;APIGroup&quot;:&quot;&quot;,&quot;APIVersion&quot;:&quot;&quot;,&quot;Namespace&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;&quot;,&quot;Subresource&quot;:&quot;&quot;,&quot;Name&quot;:&quot;&quot;,&quot;Parts&quot;:null}}```






</code></pre>

<p>I think <code>--zap-log-level</code> is what you are looking for.</p>
<p>It looks like this documentation isn't correctly in place, but you can look at the go documentation. I've also filed an issue for the Ansible docs.</p>
<p><a href="https://sdk.operatorframework.io/docs/building-operators/golang/references/logging/#setting-flags-when-deploying-to-a-cluster" rel="nofollow noreferrer">https://sdk.operatorframework.io/docs/building-operators/golang/references/logging/#setting-flags-when-deploying-to-a-cluster</a></p>
<p><a href="https://github.com/operator-framework/operator-sdk/issues/5161" rel="nofollow noreferrer">https://github.com/operator-framework/operator-sdk/issues/5161</a></p>
