Step 1: Differentiate implicitly.
We are given:
\[
\frac{x}{x-y} = \log \left( \frac{a}{x-y} \right)
\]
Differentiate both sides with respect to \( x \).
Step 2: Apply the quotient rule and chain rule.
The left-hand side is \( \frac{x}{x - y} \). Using the quotient rule:
\[
\frac{d}{dx}\left( \frac{x}{x - y} \right) = \frac{(x - y) - x(1 - \frac{dy}{dx})}{(x - y)^2}
\]
The right-hand side is \( \log \left( \frac{a}{x - y} \right) \). Differentiating:
\[
\frac{d}{dx} \left( \log \left( \frac{a}{x - y} \right) \right) = \frac{1}{x - y} \cdot (-1) \cdot \frac{dy}{dx}
\]
Equating both sides and solving for \( \frac{dy}{dx} \), we find:
\[
\frac{dy}{dx} = \frac{2y - x}{y}
\]
Step 3: Conclusion.
Thus, the value of \( \frac{dy}{dx} \) is \( \boxed{\frac{2y - x}{y}} \).