logistic regression assumptions linearity with interaction term

Hi, sorry if this is a bad question but I can't seem to get an answer anywhere.

I am running a logistic regression model and I know how to test the linearity assumption of continuous variables with the log odds. However, I am not sure if this has to be checked in the presence of an interaction term. For example if I model a continuous and categorical variable as well as their interaction, and the continuous variable fails the linearity assumption, it should still be okay to include the interaction term, is this correct? Or do I need to check linearity of the continuous variable at each level of the categorical variable?
Say for example a continuous 'time' variable is not linearly related with the log odds, but at different levels (for example 'gender') this interaction is significant in the full model. It would seem that excluding time, and thus the interaction term because it violates the linearity assumption, would not be good practice and result in a poor model.
I'd appreciate a potential reference if someone knows the answer.


Less is more. Stay pure. Stay poor.
No, this is a good question, since I have never thought about it too hard. My first inkling was also to test it at each level of the categorical variable. I usually exam the linearity via throwing a spline term in the model to see if the estimate changes across the values of a continuous variable. I once did this looking at the relationship of sex on age and just fitted two models, one for males and one for females and examined the spline for age in each one.