\documentclass[a4paper]{article}

\usepackage{pgfplots}
\usepackage{pgfplots.assert}

\begin{document}

\gdef\GOTWARNING{0}

\pgfkeysgetvalue{/pgfplots/warning/illegal user argument in log axis/.@cmd}\OLDVALUE

\pgfkeys{
	/pgfplots/warning/illegal user argument in log axis/.code args={#1#2}{%
		\gdef\GOTWARNING{1}
		\OLDVALUE{#1}{#2}\pgfeov
	}%
}%

\begin{tikzpicture}
	\begin{semilogyaxis}[ymin=0]
	\addplot+[samples=2] {exp(x)};
		
	\end{semilogyaxis}
\end{tikzpicture}

\if1\GOTWARNING
\else
	\pgfplotsassertfail{did not get the expected warning}%
\fi
\end{document}

