I think the most direct way to answer your question is provided by infinitary logic.
Given cardinals $\kappa, \lambda$ - with $\kappa\ge\lambda$ (you'll see why) - we let $\mathcal{L}_{\kappa\lambda}$ be the logic which you get by taking first-order logic and
closing under $(<\kappa)$-ary conjunctions, and
allowing quantification over $(<\lambda)$-tuples of variables.
For example, $$\bigvee_{n\in\omega} e=x*. . . *x \mbox{ ($n$-many "$*$"s)}$$ is a formula of $\mathcal{L}_{\omega_1\omega}$ in the language of groups asserting that $x$ has finite order.
The class-sized "superlogics" (not a technical term, just my term) $\mathcal{L}_{\infty\omega}$ and $\mathcal{L}_{\infty\infty}$ are defined in the obvious way. (We can similarly define $\mathcal{L}_{\infty\lambda}$ for $\lambda$ arbitrary, but generally it's the two extremes that are most interesting.)
Exercise. For every (set-sized) structure $\mathcal{A}$, there is a single sentence $\varphi\in \mathcal{L}_{\infty\infty}[\Sigma]$ (where $\Sigma$ is the language of $\mathcal{A}$) such that $\varphi$ characterizes $\mathcal{A}$ up to isomorphism.
Now, you might look at this and think, "That's kind of trivial." Let me convince you that this is in fact really cool!
First, note that the proper-class-sized-ness of $\mathcal{L}_{\infty\infty}$ is unavoidable, since there are proper-class-many set-sized structures, even of a fixed (fine, nonempty :P) language. So the fact that $\mathcal{L}_{\infty\omega}$ is big isn't a cop-out, but a necessary aspect.
Second, note that $\mathcal{L}_{\infty\infty}$ is the "smallest" infinitary logic which has this property! For each $\kappa$, we can find two non-isomorphic structures $\mathcal{A}$ and $\mathcal{B}$ which are $\mathcal{L}_{\infty\kappa}$-equivalent. This is a good exercise.
EDIT: Actually, there is a sense in which the vastly weaker logic $\mathcal{L}_{\infty\omega}$ captures every structure up to isomorphism: by a theorem of Karp (and an observation of Barwise), $\mathcal{A}\equiv_{\infty\omega}\mathcal{B}$ iff there is some forcing extension in which $\mathcal{A}\cong\mathcal{B}$! So $\mathcal{L}_{\infty\omega}$ captures every structure up to "potential isomorphism" (which is a rich concept; see e.g. http://arxiv.org/abs/math/9301208 for an analysis of how hard it can be to make two $\mathcal{L}_{\infty\omega}$-equivalent structures isomorphic, and http://www.jstor.org/stable/1997774?seq=1#page_scan_tab_contents for a beautiful result that there is no similar characterization of $\mathcal{L}_{\infty\lambda}$ for $\lambda$ uncountable).
Third, these infinitary logics are actually really interesting in and of themselves! By far the most interesting is $\mathcal{L}_{\omega_1\omega}$, which - together with its reasonably-closed countable fragments - has deep connections with descriptive set theory, model theory, and computability theory.
Fourth and finally, note that infinitary logic(s) provides a really nice way to sharpen your question. You may well ask:
For $\mathcal{A}, \mathcal{B}$ nonisomorphic structures in the same language, how hard is it to tell them apart?
One way of answering this is by asking:
For which infinitary logics $\mathcal{L}_{\kappa\lambda}$ do we have $\mathcal{A}\not\equiv_{\kappa\lambda}\mathcal{B}$?
There is a ton of research in this and related directions; let me just start you off with a fundamental result about countable structures:
(Scott's isomorphism theorem.) For $\mathcal{A}$ a countable structure in a countable language, there is a single $\varphi\in\mathcal{L}_{\omega_1\omega}$ - the Scott sentence of $\mathcal{A}$ - such that $\varphi$ characterizes $\mathcal{A}$ up to isomorphism.
By looking at fragments $\mathcal{L}_{\alpha\omega}$ of $\mathcal{L}_{\omega_1\omega}$ for $\alpha$ a countable ordinal (note that the definition given above doesn't work; my notation is purely suggestive), we can sharpen this theorem, and attach to each countable structure a countable ordinal, called the Scott rank, which measures how hard the structure is to pin down up to isomorphism.
Remark 1: Scott sentences and ranks make sense for uncountable structures, too!
Remark 2: There are sadly several different nonequivalent definitions of Scott rank; they're all basically the same, except they sometimes differ e.g. by +1. See https://math.berkeley.edu/~antonio/papers/scottRank.pdf.